diff options
author | andi <andi@splitbrain.org> | 2005-04-22 18:41:53 +0200 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-04-22 18:41:53 +0200 |
commit | 37e34a5ef6c436d6cf1525ba3643b1597cadc168 (patch) | |
tree | 8963802fb170578e997a69d35da0a3c25c100daf /inc/parserutils.php | |
parent | 723d78db98a03f01d49b69501be9dc9cf2c52b50 (diff) | |
download | rpg-37e34a5ef6c436d6cf1525ba3643b1597cadc168.tar.gz rpg-37e34a5ef6c436d6cf1525ba3643b1597cadc168.tar.bz2 |
backlink with camelcase support (untested)
darcs-hash:20050422164153-9977f-443f332fa6e591dfa352448ceb5dd24811d227a2.gz
Diffstat (limited to 'inc/parserutils.php')
-rw-r--r-- | inc/parserutils.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/inc/parserutils.php b/inc/parserutils.php index 4e38e0162..fd66c3f1e 100644 --- a/inc/parserutils.php +++ b/inc/parserutils.php @@ -111,7 +111,7 @@ function p_cached_xhtml($file){ * * @author Andreas Gohr <andi@splitbrain.org> */ -function p_cached_instructions($file){ +function p_cached_instructions($file,$cacheonly=false){ global $conf; $cache = $conf['datadir'].'/_cache/instructions/'; $cache .= md5($file.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT']); @@ -119,6 +119,15 @@ function p_cached_instructions($file){ // check if cache can be used $cachetime = @filemtime($cache); // 0 if not exists + // cache forced? + if($cacheonly){ + if($cachetime){ + return unserialize(io_readfile($cache)); + }else{ + return NULL; + } + } + if( @file_exists($file) // does the source exist && $cachetime > @filemtime($file) // cache is fresh && !isset($_REQUEST['purge']) // no purge param was set |