首頁 > CMS教程 > PHPCMS > 主體

phpcms v9如何關閉緩存

藏色散人
發布: 2019-12-27 10:44:55
原創
3062 人瀏覽過

phpcms v9如何關閉緩存

phpcms v9如何關閉快取

去掉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);
     // }
  }
登入後複製

PHP中文網,大量的免費PHPCMS教學,歡迎線上學習!

以上是phpcms v9如何關閉緩存的詳細內容。更多資訊請關注PHP中文網其他相關文章!

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!