Exemple #1
0
 /**
  * Uses the cache, if available.
  *
  * @static
  * @access public
  * @param ICacheable $obj the object we're operating on
  * @return string the cached data if available, false otherwise
  */
 public static function useCache(ICacheable &$obj)
 {
     return false;
     if (!($cacheModifiedTime = Cacher::isCached($obj))) {
         return false;
     }
     if (!$obj->useCache($cacheModifiedTime)) {
         return false;
     }
     $path = Cacher::getCacheDirectory($obj) . '/cache';
     if (!($buffer = file_get_contents($path))) {
         return false;
     }
     Site::getLog()->info("using cache for {$path}");
     return $buffer;
 }