Skip to content

Commit 253cde2

Browse files
committed
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
2 parents 817f594 + b1290da commit 253cde2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Config/ConfigCache.php

+4
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ public function write($content, array $metadata = null)
149149
// discard chmod failure (some filesystem may not support it)
150150
}
151151
}
152+
153+
if (\function_exists('opcache_invalidate') && ini_get('opcache.enable')) {
154+
@opcache_invalidate($this->file, true);
155+
}
152156
}
153157

154158
/**

0 commit comments

Comments
 (0)