UCHome rc3 含(20081201) 关闭模板缓存的方法

分享原因:当自己开发模板,或做插件时更新template/default/..目录下的htm文件,如果想马上看到效果,需要到后台更新缓存,如果频繁的更新后台,会影响开发效率.

解决方法:
修改source目录下的function_common.php
找到如下代码,注释掉if(!file_exists($objfile)) {和下面的}.
模板做好后,再改过来就行了.

  1. //模板调用
  2. function template($name) {
  3. global $_SC, $_SGLOBAL;
  4. if(strexists($name,’/’)) {
  5. $tpl = $name;
  6. } else {
  7. $tpl = “template/$_SC[template]/$name”;
  8. }
  9. $objfile = S_ROOT.’./data/tpl_cache/’.str_replace(‘/’,’_’,$tpl).’.php’;
  10. //if(!file_exists($objfile)) {
  11. include_once(S_ROOT.’./source/function_template.php’);
  12. parse_template($tpl);
  13. //}
  14. return $objfile;
  15. }

复制代码

建议官方添加一个选项,让开发者决定是否开启缓存.



发表评论

您的电子邮箱地址不会被公开。

8 + 1 =