summaryrefslogtreecommitdiff
path: root/inc/parserutils.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/parserutils.php')
-rw-r--r--inc/parserutils.php11
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