您现在的位置是:首页 > cms教程 > phpcms教程phpcms教程

phpcmsv9关闭缓存的方法

岑刚飘2025-05-03 15:08:11phpcms教程已有5人查阅

导读phpcmsv9如何关闭缓存,去掉phpcms的模板缓存最近在使用phpcms做个简单的东西,由于太简单了,所以直接在ftp上调试了,但是上传了模板文件,但是前台一直不刷新,都到要缓存目录下去删除生成的缓存php

phpcmsv9如何关闭缓存,去掉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 条评论)
昵称:
匿名发表 登录账号
         
验证码: