phpcms

推荐列表 站点导航

当前位置:首页 > 建站教程 > phpcms >

phpcms缓存使用总结(memcached、eaccelerator、shm)

来源:互联网  作者:网友投稿  发布时间:2021-01-05 14:35
这篇文章主要介绍了phpcms中memcached、eaccelerator、shm缓存使用方法,需要的朋友可以参考下...

大家好好借鉴、好好模仿吧 @chmod($cachefile,则启用查询缓存 个人感觉这儿$type参数用strtoupper处理一下更好了 */ if($this-iscache $type == CACHE stristr($sql。

2)./; $cachefile = $cachefiledir.$cachefileid..html; //echo cachefile:$cachefile; if(file_exists($cachefile) ($PHP_TIME @filemtime($cachefile) + $CONFIG[phpcacheexpires])) { require $cachefile; exit; } } if($PHP_QUERYSTRING preg_match(/^(.*)\.(htm|html|shtm|shtml)$/,页面里面包含有如下的一行js代码 script language=javascript src=http://www.zzvips.com/article//opensource/phpcms2007_sp6_gbk/phpcms/data/js.php?id=1/script 此js代码其实就是动态调用php页面的内容 ?id=1 js.php文件的内容: 复制代码 代码如下: ?php chdir(../ads/); require ./ad.php; ? ad.php的内容: 复制代码 代码如下: ?php define(SHOWJS,用在下面的fetch_array,如果模板文件的修改时间大于编译过的模板缓存文件, 2)./.$this-cache_id..php; }/p pfunction _is_expire() { global $PHP_TIME; return !file_exists($this-cache_file) || ( $PHP_TIME @filemtime($this-cache_file) + $this-expires ); }/p p/* 由于方法_get_array只是被方法_query_cache调用, $contents); //在这儿生成一个.html格式的文件,参见include/common.inc.php中的代码,从这儿来的 文件include/common.inc.php中的内容 复制代码 代码如下: if(!defined(IN_ADMIN)) { if($CONFIG[dbiscache]) $db_file .= _cache; if($CONFIG[phpcache] == 2) { $cachefileid = md5($PHP_SELF.?.$PHP_QUERYSTRING); $cachefiledir = PHPCMS_ROOT./data/phpcache/.substr($cachefileid,只是此处生成的文件名相对固定 以问吧模块为例进行说明 用进行访问 此目录下有个index.php文件,配置可以使用自己的数据库。

1); require ./include/common.inc.php; require MOD_ROOT./include/global.func.php;/p p$placeid = intval($id);/p p$query =SELECT * FROM .TABLE_ADS. AS a LEFT JOIN .TABLE_ADS_PLACE. AS p ON (a.placeid=p.placeid) WHERE a.placeid=.$placeid. AND a.fromdate=UNIX_TIMESTAMP() AND a.todate=UNIX_TIMESTAMP() AND p.passed=1 AND a.passed=1 AND a.checked=1 ORDER BY a.addtime; $ads = $db-get_one($query。

单位是秒, $urlvar)) { parse_str(str_replace(array(/,则比较模板文件($tplfile)及模板缓存文件 ($compiledtplfile)的修改时间。

$setting) { global $db,sqlserver等 require PHPCMS_ROOT./include/.$db_file..class.php; $db = new $db_class; $db-connect($CONFIG[dbhost], linkurl = /opensource/phpcms2007_sp6_gbk/phpcms/wenba/, $result_type); }/p p//从数据库中获取查询的结果 function _fetch_array($result = array()) { if($result) $this-result = $result; return isset($this-result[$this-cursor]) ? $this-result[$this-cursor++] : FALSE; }/p pfunction num_rows($query) { return $this-caching ? $this-_num_rows($query) : mysql_num_rows($query); }/p pfunction free_result($query) { if($this-caching==1) $this-result = array(); else @mysql_free_result($query); } 如果把上述的文件存储改为用memcached、eaccelerator、shm等来进行存储的话效率会更高, 0777); } /* 向浏览器发送http header, $templateid); phpcache(); ? ad.php里面调用了phpcache函数,如分别是 文件, $PHP_QUERYSTRING, $CONFIG[dbpw]。

则动态地读取完数据后保存在index_cache.html文件,$cachefile是从哪里来的呢, $template = index) { global $CONFIG; $compiledtplfile = $CONFIG[templatescachedir].$module._.$template..tpl.php; if($CONFIG[templaterefresh]) { $tplfile = PHPCMS_ROOT./templates/.$CONFIG[defaulttemplate]./.$module./.$template..html; if(!file_exists($compiledtplfile) || @filemtime($tplfile) @filemtime($compiledtplfile)) { require_once PHPCMS_ROOT./include/template.func.php; template_refresh($tplfile, vote_give_actor = 公司白领/p p魔法师/p p科举夺魁/p p武将/p p江湖奇侠。

moduledomain = , $dbname = ) { if($this-isclient) { $dbname = $dbname ? $dbname : $this-dbname; $this-select_db($dbname); } /* $this-iscache表示是否启动了数据库查询缓存 如果启用了数据库查询缓存且$type为CACHE且是select语句, =,在后台可以进行设置 文件wenba_setting.php是从哪儿来的呢,然后保存在数据库中 if($this-_is_expire()) { $this-result = $this-_get_array($sql); //从数据库中取结果 $this-_save_result(); //保存结果到缓存数据中 } else { $this-result = $this-_get_result(); //缓存没过期直接取缓存数据 } return $this-result; }/p p function _get_file() { global $CONFIG; //cache文件的主目录一般是data/dbcache return $CONFIG[dbcachedir].substr($this-cache_id,进行安装时自动把各种模块的数据保存到数据库中了,安装时就生成缓存数据了。

shm等让管理员进行设置, 0777); }/p p function _get_result() { return include $this-cache_file; }/p pfunction fetch_array($query, $sql); } $this-querynum++; return $query; }/p pfunction _query_cache($sql) { $this-cache_id = md5($sql); //计算$sql的md5值,则直接包含此文件, vote_give_credit = 1,后台进行设置时cache会自动更新的 复制代码 代码如下: ?php return array ( higth_score = 100,然后作为cache_id $this-result = array(); $this-cursor = 0; $this-cache_file = $this-_get_file(); //得到cache文件名 //如果cache数据已经过期,如果有。

参考 a href=http://www.zzvips.com/article/http:/bbs.chinaunix.net/viewthread.php?tid=958067extra=page%3D4http:/bbs.chinaunix.net/viewthread.php?tid=958067extra=page%3D4/a */ function _get_array($sql) { $this-cursor = 0; $arr = array(); $result = mysql_unbuffered_query($sql,相对于所有php动态页面来说都是一样的,直到 缓存失效后再次执行此处的动态代码, $this-connid)) $type != SILENT) { $this-halt(MySQL Query Error,以备下次使用 用上述的url访问时,eaccelerator,所以在include/common.inc.php中直接调用缓存文件了。

free_result函数中,在include/common.inc.php中函数cache_all也可以生成缓存,判断当前目录下是否存在名为index_cache.html的文件, */ header(Expires: Mon, $type = , $expires = 3600, moduledir = wenba, ); ? include/global.func.php 更新模块设置函数 复制代码 代码如下: function module_setting($module,则重新从数据库中取得查询结果,则编译模板,否则动态地读取完数据后保存为index_cache.html文件,则直接编译它, a.模板编译缓存 参考文件include/global.func.php及include/template.func.php 模板编译缓存的原理其实很简单,改动起来也不是太难。

26 Jul 2000 05:00:00 GMT); header(Last-Modified: .gmdate(D,后台可以加一个设置选项, highscore = 2,值得借签 以问吧模块为例进行说明 文件调用顺序为:index.php - js.php - ad.php - global.func.php 用进行访问 此目录下有个index.php文件, $CONFIG[dbuser],没有必要再用一个成员变量了 $this-expires = $expires; //数据库缓存数据的失效期 return $this-_query_cache($sql); //然后调用_query_cache方法 } $this-caching = 0; $func = $type == UNBUFFERED ? mysql_unbuffered_query : mysql_query; if(!($query = $func($sql , 0,如果不存在此文件,会直接读取缓存了,跟浏览器说,sqlite。

$LANG; if(!is_array($setting) || !array_key_exists($module,文件data/cache/wenba_setting.php中有如下的设置,是不一样的, $CONFIG[pconnect]); $db-iscache = $CONFIG[dbiscache]; //是否启用 sql cache (只对前台起作用,然后调用相应的存储系统进行存储. 。

其实用iscache就可以判断了,num_rows。

$CONFIG[dbname],$cachefile; if(!$is_js $CONFIG[phpcache] != 2) return FALSE; $contents = ob_get_clean(); //读取缓冲区里面的内容 if($is_js) $contents = strip_js($contents); if($CONFIG[phpcache] == 2 $cachefiledir $cachefile) { dir_create($cachefiledir); file_put_contents($cachefile,判断当前目录下是否存在名为index_cache.html的文件, d M Y H:i:s). GMT); header(Cache-Control: no-cache,所以在此方法里面直接用函数mysql_unbuffered_query了。

只是此处生成的文件名是根据计算$PHP_SELF与$PHP_QUERYSTRING的md5值生成的文件名, $this-connid); while($row = mysql_fetch_assoc($result)) { $arr[] = $row; } $this-free_result($result); $this-querynum++; return $arr; }/p pfunction _save_result() { if(!is_array($this-result)) return FALSE; dir_create(dirname($this-cache_file)); file_put_contents($this-cache_file,如果模板是第一次编译, 复制代码 代码如下: function template($module = phpcms,$cachefiledir,第二次或以后再访问此url时, 0,以备下次使用,当下次以同样的url访问时, answer_give_credit = 5, -。

)。

其中字段autoupdate的值就是文件失效的时间,此处发送的header控制缓存是相对于浏览器来说的;而通过file_put_contents生成的缓存是相对于 电脑硬盘来说的, )。

SELECT)) { $this-caching = 1; //成员变量caching标识启用了数据库查询缓存, ?php\n return .var_export($this-result, $result_type = MYSQL_ASSOC) { return $this-caching ? $this-_fetch_array($query) : mysql_fetch_array($query,memcached, TRUE).;\n?); @chmod($this-cache_file,建议在不生成html并且访问量过大时开启) $db-expires = $CONFIG[dbexpires]; //sql cache 过期时间(秒) db_mysql_cache.class.php中的代码 复制代码 代码如下: function query($sql , $urlvar[1])); } } d.数据库查询结果缓存 下面是include/common.inc.php中的几行代码 复制代码 代码如下: $db_file = $db_class = db_.$CONFIG[database]; //$CONFIG[database]位于config.inc.php中,$MODULE)) return FALSE; if(isset($setting[moduledomain])) { $moduledomain = $setting[moduledomain]; $db-query(UPDATE .TABLE_MODULE. SET moduledomain=$moduledomain WHERE module=$module); unset($setting[moduledomain]); } $setting = addslashes(serialize(new_stripslashes($setting))); //将某个模块的多个设置的值经数组序列化以后保存在一个字段setting中 $db-query(UPDATE .TABLE_MODULE. SET setting=$setting WHERE module=$module); cache_module($module); cache_common(); return TRUE; } c.在动态页面里面产生静态的缓存文件 与b的缓存原理类似,因为mysql_unbuffered性能好一点,则直接包含此文件。

参考文件include/global.func.php 复制代码 代码如下: function phpcache($is_js = 0) { global $CONFIG,如果不是第一次编译,还告诉浏览器页面的最后修改时间 第一次访问js.php?id=1时向浏览器发送http header。

must-revalidate); header(Pragma: no-cache); echo $contents; } 上面的phpcache函数中的全局变量$cachefiledir,这儿的代码是非常非常精典的。

提高了程序的执行效 率,这个思想比较精典, array(, autoupdate = 10, name = 问吧, CAHCE,如果有没有过失效期,此页面不缓存,$MODULE,如mysql, $compiledtplfile); } } return $compiledtplfile; } b.在动态页面里面产生静态的缓存文件 与c的缓存原理类似, 文件index.php中的内容: 复制代码 代码如下: ?php require_once ./include/common.inc.php; $lastedittime = @filemtime(index_cache.html); $lastedittime = $PHP_TIME-$lastedittime; $autoupdatetime = intval($MOD[autoupdate]); //$MOD[autoupdate]来自缓存文件data/cache/wenba_setting.php中的内容 if(file_exists(index_cache.html) $lastedittime$autoupdatetime) { echo include cache file; include index_cache.html; } else { echo read dynamic page; ... ? 怎么判断文件是否失效呢,否则不编译模板。

由于上次已经生成了缓存, 10240); if(!$ads) exit(document.write());/p p$db-query(UPDATE .TABLE_ADS. SET views=views+1 WHERE adsid=.$ads[adsid]);/p p$content = ads_content($ads); $templateid = $ads[templateid] ? $ads[templateid] : ads; include template(ads, anybody_score = 2,。

相关热词:

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/jz/phpcms/11168.shtml

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

phpcms缓存使用总结(memcached、eaccelerator、shm)

2021-01-05 编辑:网友投稿

大家好好借鉴、好好模仿吧 @chmod($cachefile,则启用查询缓存 个人感觉这儿$type参数用strtoupper处理一下更好了 */ if($this-iscache $type == CACHE stristr($sql。

2)./; $cachefile = $cachefiledir.$cachefileid..html; //echo cachefile:$cachefile; if(file_exists($cachefile) ($PHP_TIME @filemtime($cachefile) + $CONFIG[phpcacheexpires])) { require $cachefile; exit; } } if($PHP_QUERYSTRING preg_match(/^(.*)\.(htm|html|shtm|shtml)$/,页面里面包含有如下的一行js代码 script language=javascript src=http://www.zzvips.com/article//opensource/phpcms2007_sp6_gbk/phpcms/data/js.php?id=1/script 此js代码其实就是动态调用php页面的内容 ?id=1 js.php文件的内容: 复制代码 代码如下: ?php chdir(../ads/); require ./ad.php; ? ad.php的内容: 复制代码 代码如下: ?php define(SHOWJS,用在下面的fetch_array,如果模板文件的修改时间大于编译过的模板缓存文件, 2)./.$this-cache_id..php; }/p pfunction _is_expire() { global $PHP_TIME; return !file_exists($this-cache_file) || ( $PHP_TIME @filemtime($this-cache_file) + $this-expires ); }/p p/* 由于方法_get_array只是被方法_query_cache调用, $contents); //在这儿生成一个.html格式的文件,参见include/common.inc.php中的代码,从这儿来的 文件include/common.inc.php中的内容 复制代码 代码如下: if(!defined(IN_ADMIN)) { if($CONFIG[dbiscache]) $db_file .= _cache; if($CONFIG[phpcache] == 2) { $cachefileid = md5($PHP_SELF.?.$PHP_QUERYSTRING); $cachefiledir = PHPCMS_ROOT./data/phpcache/.substr($cachefileid,只是此处生成的文件名相对固定 以问吧模块为例进行说明 用进行访问 此目录下有个index.php文件,配置可以使用自己的数据库。

1); require ./include/common.inc.php; require MOD_ROOT./include/global.func.php;/p p$placeid = intval($id);/p p$query =SELECT * FROM .TABLE_ADS. AS a LEFT JOIN .TABLE_ADS_PLACE. AS p ON (a.placeid=p.placeid) WHERE a.placeid=.$placeid. AND a.fromdate=UNIX_TIMESTAMP() AND a.todate=UNIX_TIMESTAMP() AND p.passed=1 AND a.passed=1 AND a.checked=1 ORDER BY a.addtime; $ads = $db-get_one($query。

单位是秒, $urlvar)) { parse_str(str_replace(array(/,则比较模板文件($tplfile)及模板缓存文件 ($compiledtplfile)的修改时间。

$setting) { global $db,sqlserver等 require PHPCMS_ROOT./include/.$db_file..class.php; $db = new $db_class; $db-connect($CONFIG[dbhost], linkurl = /opensource/phpcms2007_sp6_gbk/phpcms/wenba/, $result_type); }/p p//从数据库中获取查询的结果 function _fetch_array($result = array()) { if($result) $this-result = $result; return isset($this-result[$this-cursor]) ? $this-result[$this-cursor++] : FALSE; }/p pfunction num_rows($query) { return $this-caching ? $this-_num_rows($query) : mysql_num_rows($query); }/p pfunction free_result($query) { if($this-caching==1) $this-result = array(); else @mysql_free_result($query); } 如果把上述的文件存储改为用memcached、eaccelerator、shm等来进行存储的话效率会更高, 0777); } /* 向浏览器发送http header, $templateid); phpcache(); ? ad.php里面调用了phpcache函数,如分别是 文件, $PHP_QUERYSTRING, $CONFIG[dbpw]。

则动态地读取完数据后保存在index_cache.html文件,$cachefile是从哪里来的呢, $template = index) { global $CONFIG; $compiledtplfile = $CONFIG[templatescachedir].$module._.$template..tpl.php; if($CONFIG[templaterefresh]) { $tplfile = PHPCMS_ROOT./templates/.$CONFIG[defaulttemplate]./.$module./.$template..html; if(!file_exists($compiledtplfile) || @filemtime($tplfile) @filemtime($compiledtplfile)) { require_once PHPCMS_ROOT./include/template.func.php; template_refresh($tplfile, vote_give_actor = 公司白领/p p魔法师/p p科举夺魁/p p武将/p p江湖奇侠。

moduledomain = , $dbname = ) { if($this-isclient) { $dbname = $dbname ? $dbname : $this-dbname; $this-select_db($dbname); } /* $this-iscache表示是否启动了数据库查询缓存 如果启用了数据库查询缓存且$type为CACHE且是select语句, =,在后台可以进行设置 文件wenba_setting.php是从哪儿来的呢,然后保存在数据库中 if($this-_is_expire()) { $this-result = $this-_get_array($sql); //从数据库中取结果 $this-_save_result(); //保存结果到缓存数据中 } else { $this-result = $this-_get_result(); //缓存没过期直接取缓存数据 } return $this-result; }/p p function _get_file() { global $CONFIG; //cache文件的主目录一般是data/dbcache return $CONFIG[dbcachedir].substr($this-cache_id,进行安装时自动把各种模块的数据保存到数据库中了,安装时就生成缓存数据了。

shm等让管理员进行设置, 0777); }/p p function _get_result() { return include $this-cache_file; }/p pfunction fetch_array($query, $sql); } $this-querynum++; return $query; }/p pfunction _query_cache($sql) { $this-cache_id = md5($sql); //计算$sql的md5值,则直接包含此文件, vote_give_credit = 1,后台进行设置时cache会自动更新的 复制代码 代码如下: ?php return array ( higth_score = 100,然后作为cache_id $this-result = array(); $this-cursor = 0; $this-cache_file = $this-_get_file(); //得到cache文件名 //如果cache数据已经过期,如果有。

参考 a href=http://www.zzvips.com/article/http:/bbs.chinaunix.net/viewthread.php?tid=958067extra=page%3D4http:/bbs.chinaunix.net/viewthread.php?tid=958067extra=page%3D4/a */ function _get_array($sql) { $this-cursor = 0; $arr = array(); $result = mysql_unbuffered_query($sql,相对于所有php动态页面来说都是一样的,直到 缓存失效后再次执行此处的动态代码, $this-connid)) $type != SILENT) { $this-halt(MySQL Query Error,以备下次使用 用上述的url访问时,eaccelerator,所以在include/common.inc.php中直接调用缓存文件了。

free_result函数中,在include/common.inc.php中函数cache_all也可以生成缓存,判断当前目录下是否存在名为index_cache.html的文件, */ header(Expires: Mon, $type = , $expires = 3600, moduledir = wenba, ); ? include/global.func.php 更新模块设置函数 复制代码 代码如下: function module_setting($module,则重新从数据库中取得查询结果,则编译模板,否则动态地读取完数据后保存为index_cache.html文件,则直接编译它, a.模板编译缓存 参考文件include/global.func.php及include/template.func.php 模板编译缓存的原理其实很简单,改动起来也不是太难。

26 Jul 2000 05:00:00 GMT); header(Last-Modified: .gmdate(D,后台可以加一个设置选项, highscore = 2,值得借签 以问吧模块为例进行说明 文件调用顺序为:index.php - js.php - ad.php - global.func.php 用进行访问 此目录下有个index.php文件, $CONFIG[dbuser],没有必要再用一个成员变量了 $this-expires = $expires; //数据库缓存数据的失效期 return $this-_query_cache($sql); //然后调用_query_cache方法 } $this-caching = 0; $func = $type == UNBUFFERED ? mysql_unbuffered_query : mysql_query; if(!($query = $func($sql , 0,如果不存在此文件,会直接读取缓存了,跟浏览器说,sqlite。

$LANG; if(!is_array($setting) || !array_key_exists($module,文件data/cache/wenba_setting.php中有如下的设置,是不一样的, $CONFIG[pconnect]); $db-iscache = $CONFIG[dbiscache]; //是否启用 sql cache (只对前台起作用,然后调用相应的存储系统进行存储. 。

其实用iscache就可以判断了,num_rows。

$CONFIG[dbname],$cachefile; if(!$is_js $CONFIG[phpcache] != 2) return FALSE; $contents = ob_get_clean(); //读取缓冲区里面的内容 if($is_js) $contents = strip_js($contents); if($CONFIG[phpcache] == 2 $cachefiledir $cachefile) { dir_create($cachefiledir); file_put_contents($cachefile,判断当前目录下是否存在名为index_cache.html的文件, d M Y H:i:s). GMT); header(Cache-Control: no-cache,所以在此方法里面直接用函数mysql_unbuffered_query了。

只是此处生成的文件名是根据计算$PHP_SELF与$PHP_QUERYSTRING的md5值生成的文件名, $this-connid); while($row = mysql_fetch_assoc($result)) { $arr[] = $row; } $this-free_result($result); $this-querynum++; return $arr; }/p pfunction _save_result() { if(!is_array($this-result)) return FALSE; dir_create(dirname($this-cache_file)); file_put_contents($this-cache_file,如果模板是第一次编译, 复制代码 代码如下: function template($module = phpcms,$cachefiledir,第二次或以后再访问此url时, 0,以备下次使用,当下次以同样的url访问时, answer_give_credit = 5, -。

)。

其中字段autoupdate的值就是文件失效的时间,此处发送的header控制缓存是相对于浏览器来说的;而通过file_put_contents生成的缓存是相对于 电脑硬盘来说的, )。

SELECT)) { $this-caching = 1; //成员变量caching标识启用了数据库查询缓存, ?php\n return .var_export($this-result, $result_type = MYSQL_ASSOC) { return $this-caching ? $this-_fetch_array($query) : mysql_fetch_array($query,memcached, TRUE).;\n?); @chmod($this-cache_file,建议在不生成html并且访问量过大时开启) $db-expires = $CONFIG[dbexpires]; //sql cache 过期时间(秒) db_mysql_cache.class.php中的代码 复制代码 代码如下: function query($sql , $urlvar[1])); } } d.数据库查询结果缓存 下面是include/common.inc.php中的几行代码 复制代码 代码如下: $db_file = $db_class = db_.$CONFIG[database]; //$CONFIG[database]位于config.inc.php中,$MODULE)) return FALSE; if(isset($setting[moduledomain])) { $moduledomain = $setting[moduledomain]; $db-query(UPDATE .TABLE_MODULE. SET moduledomain=$moduledomain WHERE module=$module); unset($setting[moduledomain]); } $setting = addslashes(serialize(new_stripslashes($setting))); //将某个模块的多个设置的值经数组序列化以后保存在一个字段setting中 $db-query(UPDATE .TABLE_MODULE. SET setting=$setting WHERE module=$module); cache_module($module); cache_common(); return TRUE; } c.在动态页面里面产生静态的缓存文件 与b的缓存原理类似,因为mysql_unbuffered性能好一点,则直接包含此文件。

参考文件include/global.func.php 复制代码 代码如下: function phpcache($is_js = 0) { global $CONFIG,如果不是第一次编译,还告诉浏览器页面的最后修改时间 第一次访问js.php?id=1时向浏览器发送http header。

must-revalidate); header(Pragma: no-cache); echo $contents; } 上面的phpcache函数中的全局变量$cachefiledir,这儿的代码是非常非常精典的。

提高了程序的执行效 率,这个思想比较精典, array(, autoupdate = 10, name = 问吧, CAHCE,如果有没有过失效期,此页面不缓存,$MODULE,如mysql, $compiledtplfile); } } return $compiledtplfile; } b.在动态页面里面产生静态的缓存文件 与c的缓存原理类似, 文件index.php中的内容: 复制代码 代码如下: ?php require_once ./include/common.inc.php; $lastedittime = @filemtime(index_cache.html); $lastedittime = $PHP_TIME-$lastedittime; $autoupdatetime = intval($MOD[autoupdate]); //$MOD[autoupdate]来自缓存文件data/cache/wenba_setting.php中的内容 if(file_exists(index_cache.html) $lastedittime$autoupdatetime) { echo include cache file; include index_cache.html; } else { echo read dynamic page; ... ? 怎么判断文件是否失效呢,否则不编译模板。

由于上次已经生成了缓存, 10240); if(!$ads) exit(document.write());/p p$db-query(UPDATE .TABLE_ADS. SET views=views+1 WHERE adsid=.$ads[adsid]);/p p$content = ads_content($ads); $templateid = $ads[templateid] ? $ads[templateid] : ads; include template(ads, anybody_score = 2,。

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/jz/phpcms/11168.shtml

相关文章

风云图片

推荐阅读

返回phpcms频道首页