通过本教程可以实现ECSHOP自动更新缓存功能,非常实用。
教程开始:
打开:includes/init.php 在最后添加以下代码:
if (is_temps()){ clear_all_files(); $sql="update ".$ecs->table('shop_config') ."set value=".time()." where code='"."last_clear_time '"; $db->query($sql);} function is_temps(){ if(time()-$_CFG['last_clear_time']<10000) { return(false); } else { return(true); }}其中10000为间隔时间 单位秒
后台的“数据库管理-SQL查询”中执行
INSERT INTO `ecs_shop_config` VALUES (65535, 10, 'last_clear_time', 'text', '', '', '1274090777', 1);
表前缀更改为自己的
65535 这个值也可以更改,但是不建议少于1000 如果少于1000,可能对其他值会产生影响
