Example #1
0
 public static function read($module, $id, $timeout = null)
 {
     clearstatcache();
     if ($timeout === null) {
         $timeout = xConfig::get('GLOBAL', 'cacheTimeout');
     }
     $file_exists = file_exists($file = xConfig::get('PATH', 'CACHE') . '/' . $module . '/' . md5($module . $id));
     if ($timeout === false) {
         $timer = true;
     } elseif ($file_exists) {
         $timer = filemtime($file) + $timeout > time();
     }
     if ($file && $timer) {
         return xCacheFileDriver::readFile($module, md5($module . $id));
     } elseif (!$timer && $file) {
         xCacheFileDriver::clear($module, $id);
     }
 }
Example #2
0
 function getTpl($tpl, $domain)
 {
     return xCacheFileDriver::serializedRead($this->_moduleName, $domain . '/' . $tpl, false);
 }