首頁  >  文章  >  CMS教程  >  phpcms v9如何關閉緩存

phpcms v9如何關閉緩存

藏色散人
藏色散人原創
2019-12-27 10:44:553034瀏覽

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中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn