当前位置: 首页>>代码示例>>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;未经允许,请勿转载。