您当前的位置:首页 > 网站建设笔记 >

discuzX3.3 discuz_application类的_init_setting()方法

0
<?php
private function _init_setting() {
	//是否初始化设置,默认情况下为true
	if ($this->init_setting) {
		//注意:var就是G变量
		//检查$_G['setting']是否具有空值
		if (empty($this->var['setting'])) {
			//缓存设置文件
			$this->cachelist[] = 'setting';
		}
		//检查$_G['style']是否具有空值
		if (empty($this->var['style'])) {
			//默认风格缓存设置
			$this->cachelist[] = 'style_default';
		}
		//检查$_G['cache']['cronnextrun']是否具有值
		if (!isset($this->var['cache']['cronnextrun'])) {
			//缓存计划任务
			$this->cachelist[] = 'cronnextrun';
		}
	}
	//打印当前$this->cachelist的值
	//echo "<pre>".var_export($this->cachelist,1)."</pre>";exit;
	//$this->cachelist = array(0=>'announcements', 1=>'onlinelist', 2=>'forumlinks', 3=>'heats', 4=>'historyposts', 5=>'onlinerecord', 6=>'userstats', 7=>'diytemplatenameforum', 8=>'plugin', 9=>'pluginlanguage_system', 10=>'setting', 11=>'style_default', 12=>'cronnextrun',);

	//加载缓存列表中存在的缓存数据,loadcache():读取缓存
	!empty($this->cachelist) && loadcache($this->cachelist);
	if (!is_array($this->var['setting'])) {
		$this->var['setting'] = array();
	}
}
?>

下一步转向loadcache($this->cachelist)

建站咨询

在线咨询真诚为您提供专业解答服务

咨询热线

137 1731 25507×24小时服务热线

微信交流

二维码终于等到你,还好我没放弃
返回顶部