Permalink
Browse files

bug #24421 [Config] Fix dumped files invalidation by OPCache (nicolas…

…-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[Config] Fix dumped files invalidation by OPCache

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

While demoing Flex, I've noticed that container invalidation takes a few seconds on my setup.
I've debugged that down to OPcache, which serves the legacy container while it's been overridden.
Let's invalidate the file explicitly when it changes.

Commits
-------

b1290da [Config] Fix dumped files invalidation by OPCache
  • Loading branch information...
fabpot committed Oct 4, 2017
2 parents 817f594 + b1290da commit 253cde2062af53d6ef4dc54f7d57a11947dd8a7b
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/Symfony/Component/Config/ConfigCache.php
@@ -149,6 +149,10 @@ public function write($content, array $metadata = null)
// discard chmod failure (some filesystem may not support it)
}
}
if (\function_exists('opcache_invalidate') && ini_get('opcache.enable')) {
@opcache_invalidate($this->file, true);
}
}
/**

0 comments on commit 253cde2

Please sign in to comment.