コード例 #1
0
 public function __construct($opts)
 {
     if (is_object(self::$_instance)) {
         throw new Exception('Instance of cms_filecache_driver already exists');
     }
     self::$_instance = $this;
     $_keys = array('lifetime', 'locking', 'cache_dir', 'auto_cleaning', 'blocking');
     if (is_array($opts)) {
         foreach ($opts as $key => $value) {
             if (in_array($key, $_keys)) {
                 $tmp = '_' . $key;
                 $this->{$tmp} = $value;
             }
         }
     }
 }
コード例 #2
0
 public static function clear_cached_checks()
 {
     $driver = new \cms_filecache_driver(array('cache_dir' => TMP_CACHE_LOCATION, 'lifetime' => 24 * 3600));
     $driver->clear(__CLASS__);
 }