X-Git-Url: https://projects.mako.cc/source/scuttle/blobdiff_plain/c20b44263a89d8bf1a78bfa632daaae3cb4f1da2..fbab1fbe884c9f1f0fbd419ad0db0793ef52dbaf:/services/cacheservice.php?ds=sidebyside diff --git a/services/cacheservice.php b/services/cacheservice.php index fe66d38..2169e2d 100644 --- a/services/cacheservice.php +++ b/services/cacheservice.php @@ -1,38 +1,36 @@ basedir = $GLOBALS['dir_cache']; - } + function CacheService() { + $this->basedir = $GLOBALS['dir_cache']; + } - function Start($hash, $time = 300) { - $cachefile = $this->basedir .'/'. $hash . $this->fileextension; - if (file_exists($cachefile) && time() < filemtime($cachefile) + $time) { - @readfile($cachefile); - echo "\n\n"; - unset($cachefile); - exit; - } - ob_start("ob_gzhandler"); + function Start($hash, $time = 300) { + $cachefile = $this->basedir .'/'. $hash . $this->fileextension; + if (file_exists($cachefile) && time() < filemtime($cachefile) + $time) { + @readfile($cachefile); + echo "\n\n"; + unset($cachefile); + exit; } + ob_start("ob_gzhandler"); + } - function End($hash) { - $cachefile = $this->basedir .'/'. $hash . $this->fileextension; - $handle = fopen($cachefile, 'w'); - fwrite($handle, ob_get_contents()); - fclose($handle); - ob_flush(); - } + function End($hash) { + $cachefile = $this->basedir .'/'. $hash . $this->fileextension; + $handle = fopen($cachefile, 'w'); + fwrite($handle, ob_get_contents()); + fclose($handle); + ob_flush(); + } } -?> \ No newline at end of file