-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] ApcuAdapter::isSupported() should return true when apc.enable_cli=Off #23091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a62c2a1
to
8ef97d2
Compare
@@ -118,7 +118,7 @@ protected function doSave(array $values, $lifetime) | |||
$ok = $this->write($file, '<?php return '.var_export($data, true).';') && $ok; | |||
|
|||
if ($allowCompile) { | |||
@opcache_compile_file($file); | |||
@opcache_invalidate($file, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just verified with @jpauli: opcache_compile_file
does not invalidate. Let's call only opcache_invalidate
.
8ef97d2
to
aadf263
Compare
@@ -69,7 +69,7 @@ protected function doHave($id) | |||
*/ | |||
protected function doClear($namespace) | |||
{ | |||
return isset($namespace[0]) && class_exists('APCuIterator', false) | |||
return isset($namespace[0]) && class_exists('APCuIterator', false) && ('cli' !== PHP_SAPI || ini_get('apc.enable_cli')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new APCuIterator
triggers a fatal error when apcu is not enabled...
Thank you @nicolas-grekas. |
… apc.enable_cli=Off (nicolas-grekas) This PR was merged into the 3.2 branch. Discussion ---------- [Cache] ApcuAdapter::isSupported() should return true when apc.enable_cli=Off | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - By being sensitive to apc.enable_cli, CLI cache warmup is broken when the setting is set to off because a PhpFilesAdapter will be warmed up by the CLI, whereas the Web mode will look at the FilesystemAdapter pools, which will be empty. Commits ------- aadf263 [Cache] APCu isSupported() should return true when apc.enable_cli=Off
By being sensitive to apc.enable_cli, CLI cache warmup is broken when the setting is set to off because a PhpFilesAdapter will be warmed up by the CLI, whereas the Web mode will look at the FilesystemAdapter pools, which will be empty.