From 47b2d319dce63bf054ff2428b9efedccc6b695f7 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 3 Mar 2007 21:22:32 +0100 Subject: never build instructions twice in the same run FS#1090 When a page was called with purge darcs-hash:20070303202232-7ad00-03e05dc32646563688307ae51b6594d223bad938.gz --- inc/parserutils.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'inc/parserutils.php') diff --git a/inc/parserutils.php b/inc/parserutils.php index ef4541009..1caad257e 100644 --- a/inc/parserutils.php +++ b/inc/parserutils.php @@ -173,15 +173,18 @@ function p_cached_output($file, $format='xhtml', $id='') { */ function p_cached_instructions($file,$cacheonly=false,$id='') { global $conf; + static $run = null; + if(is_null($run)) $run = array(); $cache = new cache_instructions($id, $file); - if ($cacheonly || $cache->useCache()) { + if ($cacheonly || $cache->useCache() || isset($run[$file])) { return $cache->retrieveCache(); } else if (@file_exists($file)) { // no cache - do some work $ins = p_get_instructions(io_readfile($file)); $cache->storeCache($ins); + $run[$file] = true; // we won't rebuild these instructions in the same run again return $ins; } -- cgit v1.2.3