From 256f57e55f5d1759a3c431b129005d878e87ecb7 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 22 Sep 2011 22:08:10 +0200 Subject: [PATCH] tweaked previous merge --- doc/recipes.rst | 18 ++++++++---------- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/doc/recipes.rst b/doc/recipes.rst index a9034e1..d7ff0e5 100644 --- a/doc/recipes.rst +++ b/doc/recipes.rst @@ -255,20 +255,18 @@ how you can do it:: } catch (Twig_Error_Syntax $e) { // $template contains one or more syntax errors -Refreshing modified templates when APC is switched on with apc.stat = 0 ------------------------------------------------------------------------ +Refreshing modified Templates when APC is enabled and apc.stat = 0 +------------------------------------------------------------------ -When using APC to cache, apc.stat is 0 and PHP caching of templates is enabled -the result won't show until cache is cleared. To get around this one can extend -Twig_Environment and force update cache when Twig rewrites the cache:: +When using APC with ``apc.stat`` set to ``0`` and Twig cache enabled, clearing +the template cache won't update the APC cache. To get around this, one can +extend ``Twig_Environment`` and force the update of the APC cache when Twig +rewrites the cache:: - /** - * Modified Twig Environment for APC bytecode cache support - */ class Twig_Environment_APC extends Twig_Environment { - - protected function writeCacheFile($file, $content) { + protected function writeCacheFile($file, $content) + { parent::writeCacheFile($file, $content); // Compile cached file into bytecode cache -- 1.7.2.5