File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
lib/internal/Magento/Framework/App/DeploymentConfig Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ public function load($fileKey = null)
100
100
if ($ fileKey ) {
101
101
$ filePath = $ path . '/ ' . $ this ->configFilePool ->getPath ($ fileKey );
102
102
if ($ fileDriver ->isExists ($ filePath )) {
103
+ $ this ->refreshCache ($ filePath );
103
104
$ result = include $ filePath ;
104
105
if (!is_array ($ result )) {
105
106
throw new RuntimeException (new Phrase ("Invalid configuration file: '%1' " , [$ filePath ]));
@@ -110,6 +111,7 @@ public function load($fileKey = null)
110
111
foreach ($ configFiles as $ file ) {
111
112
$ configFile = $ path . '/ ' . $ file ;
112
113
if ($ fileDriver ->isExists ($ configFile )) {
114
+ $ this ->refreshCache ($ configFile );
113
115
$ fileData = include $ configFile ;
114
116
if (!is_array ($ fileData )) {
115
117
throw new RuntimeException (new Phrase ("Invalid configuration file: '%1' " , [$ configFile ]));
@@ -124,4 +126,17 @@ public function load($fileKey = null)
124
126
}
125
127
return $ result ?: [];
126
128
}
129
+
130
+ /**
131
+ * Invalidate cache
132
+ *
133
+ * @param string $filePath
134
+ */
135
+ private function refreshCache (string $ filePath ): void
136
+ {
137
+ if (function_exists ('opcache_invalidate ' )
138
+ && filter_var (ini_get ('opcache.enable ' ), FILTER_VALIDATE_BOOLEAN )) {
139
+ opcache_invalidate ($ filePath );
140
+ }
141
+ }
127
142
}
You can’t perform that action at this time.
0 commit comments