Commit be66f43d by Carsten Brandt

invalidate opcache of extensions.php file in composer installer

fixes #1480
parent 7b032338
......@@ -135,6 +135,10 @@ class Installer extends LibraryInstaller
if (!is_file($file)) {
return [];
}
// invalidate opcache of extensions.php if exists
if (function_exists('opcache_invalidate')) {
opcache_invalidate($file, true);
}
$extensions = require($file);
$vendorDir = str_replace('\\', '/', $this->vendorDir);
......@@ -159,6 +163,10 @@ class Installer extends LibraryInstaller
$file = $this->vendorDir . '/' . self::EXTENSION_FILE;
$array = str_replace("'<vendor-dir>", '$vendorDir . \'', var_export($extensions, true));
file_put_contents($file, "<?php\n\n\$vendorDir = dirname(__DIR__);\n\nreturn $array;\n");
// invalidate opcache of extensions.php if exists
if (function_exists('opcache_invalidate')) {
opcache_invalidate($file, true);
}
}
protected function linkYiiBaseFiles()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment