去掉phpcms的模板缓存

去掉phpcms的模板缓存

最近在使用phpcms做个简单的东西,由于太简单了,所以直接在ftp上调试了,但是上传了模板文件,但是前台一直不刷新,都到要缓存目录下去删除生成的缓存php,来回操作几次感觉好烦,但是在网上没有找到合适的文章来关掉他,所以就简单粗爆地,先干掉缓存了


global.func.php中有函数名为
function template($module = 'content', $template = 'index', $style = '')

  if (file_exists(PC_PATH . 'templates' . DIRECTORY_SEPARATOR . $style . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . $template . '.html'))
  {
      if (!file_exists($compiledtplfile) || (@filemtime(PC_PATH . 'templates' . DIRECTORY_SEPARATOR . $style . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . $template . '.html') > @filemtime($compiledtplfile)))
      {
          $template_cache->template_compile($module, $template, $style);
      }
  }

把里边的 if 去掉就可以了,这样多么简单粗暴啊,这样每次都从编译一下,不过一个简单的小项目这个也不用太在意了

  if (file_exists(PC_PATH . 'templates' . DIRECTORY_SEPARATOR . $style . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . $template . '.html'))
  {
    //  if (!file_exists($compiledtplfile) || (@filemtime(PC_PATH . 'templates' . DIRECTORY_SEPARATOR . $style . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . $template . '.html') > @filemtime($compiledtplfile)))
     // {
          $template_cache->template_compile($module, $template, $style);
     // }
  }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值