public function cache_init($file_path) { $cache_key = md5($file_path); $cache_path = \Config::get('parser.View_Jade.cache_dir', null) . substr($cache_key, 0, 2) . DS . substr($cache_key, 2, 2); if ($cache_path !== null and !is_dir($cache_path)) { mkdir($cache_path, 0777, true); } static::$_cache = $cache_path; }
public static function clear($filename = null) { if (is_null($filename)) { $filename = __DIR__ . '/../cache/xml-selectors.json'; if (is_file($filename)) { unlink($filename); } } static::$_isUptoDate = true; static::$_cache = []; }
public static function rules($type, $rules, $reset = false) { $var = '_' . $type; if ($reset) { static::${$var} = $rules; } elseif ($type === 'uninflected') { static::$_uninflected = array_merge($rules, static::$_uninflected); } else { static::${$var} = $rules + static::${$var}; } static::$_cache = []; }
/** * */ public static function clear() { static::$_cache = []; }
/** * Affecte le cache * * @param Zend_Cache_Core $cache */ public static function setCache(Zend_Cache_Core $cache) { $cache->setOption('automatic_serialization', true); static::$_cache = $cache; }
/** * */ public static function clear() { static::$_cache = array(); }
/** * Empty the cache. */ public static function flushCache() { static::$_cache = []; }
/** * Drops the entire cache or a specific key. * * ## Usage: * * ```php * static::dropCache('user_cache'); // removes "user_cache" only * static::dropCache(); // removes every key * ``` * * @param string|null $key Cache key to clear, if NULL the entire cache * will be erased. * @return void */ public static function dropCache($key = null) { if ($key !== null && isset(static::$_cache[$key])) { unset(static::$_cache[$key]); } else { static::$_cache = []; } }
protected static function clear_cache() { static::$_cache = []; }