當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Smarty::clearAllCache方法代碼示例

本文整理匯總了PHP中Smarty::clearAllCache方法的典型用法代碼示例。如果您正苦於以下問題:PHP Smarty::clearAllCache方法的具體用法?PHP Smarty::clearAllCache怎麽用?PHP Smarty::clearAllCache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Smarty的用法示例。


在下文中一共展示了Smarty::clearAllCache方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render

 public function render($name, array $values = array())
 {
     if (defined('ENV_DEV')) {
         //$this->engine->clearCacheFiles();
         //$this->engine->clearTemplateCache();
         $this->engine->clearAllCache();
         $this->engine->clearCompiledTemplate();
     }
     $template = $this->engine->createTemplate($name . $this->suffix);
     $template->assign($values);
     return $template->fetch();
 }
開發者ID:php-nik,項目名稱:core,代碼行數:12,代碼來源:SmartyProvider.php

示例2: CacheExpire

 /**
  * Expires the cache
  *
  * @param boolean $expireAll expire the whole cache
  */
 public function CacheExpire($expireAll = false)
 {
     if ($expireAll) {
         $this->tpl->clearAllCache();
         return;
     }
     if (!$this->project) {
         return;
     }
     $epoch = $this->GetProject()->GetEpoch();
     if (empty($epoch)) {
         return;
     }
     $age = $this->GetProject()->GetAge();
     $this->tpl->clearCache(null, $this->GetCacheKeyPrefix(), null, $age);
     $this->tpl->clearCache('projectlist.tpl', $this->GetCacheKeyPrefix(false), null, $age);
 }
開發者ID:hmcclungiii,項目名稱:gitphp,代碼行數:22,代碼來源:ControllerBase.class.php

示例3: check_template_invalidation

 /**
  * Handle the lazy template cache invalidation
  *
  * @param  string  $template template name
  * @param  string  $cache_id      cache id
  * @param  string  $compile_id    compile id
  */
 public function check_template_invalidation($template, $cache_id, $compile_id)
 {
     static $last_flush = null;
     if (!file_exists($this->getCacheDir() . 'last_template_flush')) {
         @touch($this->getCacheDir() . 'last_template_flush', time());
     } elseif (defined('_DB_PREFIX_')) {
         if ($last_flush === null) {
             $sql = 'SELECT UNIX_TIMESTAMP(last_flush) as last_flush FROM `' . _DB_PREFIX_ . 'smarty_last_flush` WHERE type=\'template\'';
             $last_flush = Db::getInstance()->getValue($sql, false);
         }
         if ((int) $last_flush && @filemtime($this->getCacheDir() . 'last_template_flush') < $last_flush) {
             @touch($this->getCacheDir() . 'last_template_flush', time());
             parent::clearAllCache();
         } else {
             if ($cache_id !== null && (is_object($cache_id) || is_array($cache_id))) {
                 $cache_id = null;
             }
             if ($this->is_in_lazy_cache($template, $cache_id, $compile_id) === false) {
                 // insert in cache before the effective cache creation to avoid nasty race condition
                 $this->insert_in_lazy_cache($template, $cache_id, $compile_id);
                 parent::clearCache($template, $cache_id, $compile_id);
             }
         }
     }
 }
開發者ID:M03G,項目名稱:PrestaShop,代碼行數:32,代碼來源:SmartyCustom.php

示例4: Smarty

global $config;
$config_tmp = $db->fetchAll($get_sysconf);
foreach ($config_tmp as $tmp) {
    $config[$tmp['key']] = $tmp['value'];
}
//初始化smarty對象
global $smarty;
$smarty = new Smarty();
$smarty->setCompileDir(ROOT_PATH . 'data/compiles');
$smarty->setTemplateDir(ROOT_PATH . 'themes/' . $config['themes']);
$smarty->setCacheDir(ROOT_PATH . 'data/caches');
$smarty->setCacheLifetime(2);
//設置緩存文件超時時間為1800秒
//Debug模式下每次都強製編譯輸出
if ($debug_mode) {
    $smarty->clearAllCache();
    $smarty->clearCompiledTemplate();
    $smarty->force_compile = true;
}
//設置係統設置
assign('config', $config);
//設置語言包
assign('LANG', $lang);
//設置網站參數
assign('config', $config);
//設置模板路徑
assign('template_dir', 'themes/' . $config['themes'] . '/');
//讀取ukey參數,記錄推薦人信息
$ukey = getGET('ukey');
if ($ukey != '') {
    $ukey = intval($ukey);
開發者ID:Winsen1990,項目名稱:easyilife,代碼行數:31,代碼來源:init.inc.php

示例5: clearAllCache

 public function clearAllCache($exp_time = null, $type = null)
 {
     return $this->smarty->clearAllCache($exp_time, $type);
 }
開發者ID:Lazary,項目名稱:webasyst,代碼行數:4,代碼來源:waSmarty3View.class.php

示例6: clearCache

 /**
  * Clear cache for Smarty
  *
  * @param Smarty $smarty
  */
 public static function clearCache($smarty, $tpl = false, $cache_id = null, $compile_id = null)
 {
     return $smarty->clearAllCache();
 }
開發者ID:jicheng17,項目名稱:vipinsg,代碼行數:9,代碼來源:Tools.php

示例7: clearAllCache

 public function clearAllCache()
 {
     $this->smarty->clearAllCache();
 }
開發者ID:skullyframework,項目名稱:skully,代碼行數:4,代碼來源:SmartyAdapter.php


注:本文中的Smarty::clearAllCache方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。