From 37e34a5ef6c436d6cf1525ba3643b1597cadc168 Mon Sep 17 00:00:00 2001 From: andi Date: Fri, 22 Apr 2005 18:41:53 +0200 Subject: backlink with camelcase support (untested) darcs-hash:20050422164153-9977f-443f332fa6e591dfa352448ceb5dd24811d227a2.gz --- inc/parserutils.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'inc/parserutils.php') 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 */ -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 -- cgit v1.2.3