summaryrefslogtreecommitdiff
path: root/inc/parserutils.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2007-03-03 21:22:32 +0100
committerAndreas Gohr <andi@splitbrain.org>2007-03-03 21:22:32 +0100
commit47b2d319dce63bf054ff2428b9efedccc6b695f7 (patch)
treef22bfdb3b1e061283f49615db0668816960e0302 /inc/parserutils.php
parentea2a4271c2f25e91be30f24c41c74c2bc23fa2d9 (diff)
downloadrpg-47b2d319dce63bf054ff2428b9efedccc6b695f7.tar.gz
rpg-47b2d319dce63bf054ff2428b9efedccc6b695f7.tar.bz2
never build instructions twice in the same run FS#1090
When a page was called with purge darcs-hash:20070303202232-7ad00-03e05dc32646563688307ae51b6594d223bad938.gz
Diffstat (limited to 'inc/parserutils.php')
-rw-r--r--inc/parserutils.php5
1 files changed, 4 insertions, 1 deletions
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;
}