mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-06 23:48:50 +00:00
Enable bytecode invalidation with auto_reload
This commit is contained in:
+4
-4
@@ -329,11 +329,11 @@ If you iterate over a set of files, you can pass the filename to the
|
|||||||
is enforced during template rendering (as Twig needs the context for some
|
is enforced during template rendering (as Twig needs the context for some
|
||||||
checks like allowed methods on objects).
|
checks like allowed methods on objects).
|
||||||
|
|
||||||
Refreshing modified Templates when OPcache or APC is enabled
|
Refreshing modified Templates when OPcache is enabled
|
||||||
------------------------------------------------------------
|
-----------------------------------------------------
|
||||||
|
|
||||||
When using OPcache with ``opcache.validate_timestamps`` set to ``0`` or APC
|
When using OPcache with ``opcache.validate_timestamps`` set to ``0``,
|
||||||
with ``apc.stat`` set to ``0`` and Twig cache enabled, clearing the template
|
Twig cache enabled and auto reload disabled, clearing the template
|
||||||
cache won't update the cache.
|
cache won't update the cache.
|
||||||
|
|
||||||
To get around this, force Twig to invalidate the bytecode cache::
|
To get around this, force Twig to invalidate the bytecode cache::
|
||||||
|
|||||||
+1
-1
@@ -264,7 +264,7 @@ class Environment
|
|||||||
{
|
{
|
||||||
if (\is_string($cache)) {
|
if (\is_string($cache)) {
|
||||||
$this->originalCache = $cache;
|
$this->originalCache = $cache;
|
||||||
$this->cache = new FilesystemCache($cache);
|
$this->cache = new FilesystemCache($cache, $this->autoReload ? FilesystemCache::FORCE_BYTECODE_INVALIDATION : 0);
|
||||||
} elseif (false === $cache) {
|
} elseif (false === $cache) {
|
||||||
$this->originalCache = $cache;
|
$this->originalCache = $cache;
|
||||||
$this->cache = new NullCache();
|
$this->cache = new NullCache();
|
||||||
|
|||||||
Reference in New Issue
Block a user