Skip to content

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Jun 7, 2017

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.


if ($allowCompile) {
@opcache_compile_file($file);
@opcache_invalidate($file, true);
Copy link
Member Author

@nicolas-grekas nicolas-grekas Jun 8, 2017

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.

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'))
Copy link
Member Author

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...

@fabpot
Copy link
Member

fabpot commented Jun 9, 2017

Thank you @nicolas-grekas.

@fabpot fabpot merged commit aadf263 into symfony:3.2 Jun 9, 2017
fabpot added a commit that referenced this pull request Jun 9, 2017
… 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
This was referenced Jul 4, 2017
@nicolas-grekas nicolas-grekas deleted the cache-apcu branch July 10, 2017 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants