コード例 #1
0
ファイル: fragment.php プロジェクト: ZerGabriel/cms-1
 /**
  * 
  * @param   string  $name       fragment name
  * @param   integer $lifetime   fragment cache lifetime
  * @param   boolean $i18n       multilingual fragment support
  * @return  string
  */
 public static function get($name, $lifetime = NULL, $i18n = NULL)
 {
     // Set the cache lifetime
     $lifetime = $lifetime === NULL ? Fragment::$lifetime : (int) $lifetime;
     // Get the cache key name
     $cache_key = Fragment::_cache_key($name, $i18n);
     // If cache lifetime < 0 then clear
     if ($lifetime < 0) {
         Fragment::delete($name, $i18n);
     }
     return Cache::instance()->get($cache_key);
 }
コード例 #2
0
ファイル: album.php プロジェクト: andygoo/kohana_demo
 private function delete_album_fragment($id)
 {
     try {
         Fragment::delete("album_{$id}");
     } catch (Exception $e) {
     }
 }
コード例 #3
0
ファイル: decorator.php プロジェクト: ZerGabriel/cms-1
 /**
  * Метод очистки кеша виджета.
  * 
  * @todo Не совсем корректно работает с динамическим кешем
  * @return \Model_Widget_Decorator
  */
 public function clear_cache()
 {
     if ($this->caching === TRUE) {
         Fragment::delete($this->get_cache_id());
     }
     return $this;
 }