首页 > 其他 > 详细

//6小时更新一次首页

时间:2016-01-24 18:08:13      阅读:155      评论:0      收藏:0      [点我收藏+]


$cachetime = 360;//6小时更新一次首页
 
if($cachetime) {
$cachefile = S_ROOT.‘./data/data_index.php‘;
$lockfile = S_ROOT.‘./data/data_index.lock‘;

if(file_exists($cachefile)) {
@$mktime = filemtime($cachefile);
if($_SGLOBAL[‘timestamp‘] - $mktime > $cachetime*60) {
if(file_exists($lockfile)) {
$writestate = false;
@touch($lockfile);
}

} else {
include_once($cachefile);
$cachelost = false;
}
}
}

//6小时更新一次首页

原文:http://www.cnblogs.com/firecode/p/5155388.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!