control_name = $p_c;//指定模块 $system_time = time() + (defined("TIMETUNING") ? TIMETUNING : 0); $APP->system_time = $system_time;//系统时间 //执行session信息 $APP->session_lib->start($APP->db,$APP->db->prefix); //运行以下参数,以实现在函数中使用Control操作 function sys_init() { global $APP; return $APP; } // function sys_app($var) { $app = sys_init(); return $app->$var; } //将数据存到URL类中 $APP->set_config($config); $APP->url = $APP->url(array("c"=>$p_c,"f"=>$p_f,"d"=>$p_d)); $APP->tpl->assign("sys_app",$APP); //加载公共函数 $dirlist = $APP->file_lib->ls(APP); foreach($dirlist AS $key=>$value) { $basename = strtolower(basename($value)); if(substr($basename,-8) == "func.php") { include_once($value); } } unset($dirlist); //判断自动载入的model配置信息 if(file_exists(APP."model.config.php")) { include(APP."model.config.php"); if($_model_config["autoload"] && is_array($_model_config["autoload"]) && count($_model_config["autoload"])>0) { foreach($_model_config["autoload"] AS $key=>$value) { $APP->load_model($value); } } if($_model_config["autoload_function"] && is_array($_model_config["autoload_function"]) && count($_model_config["autoload_function"])>0) { foreach($_model_config["autoload_function"] AS $key=>$value) { if(function_exists($value)) { $value(); } } } } //判断是否有新的语言模块,有就重写 if($APP->langconfig_m) { if($_GET["langid"]) { $_SESSION["sys_lang_id"] = $_GET["langid"]; } $_tmp_langid = $_SESSION["sys_lang_id"] ? $_SESSION["sys_lang_id"] : ""; $_tmp_rs = $APP->langconfig_m->get_one($_tmp_langid); if($_tmp_rs) { $_SESSION["sys_lang_id"] = $_tmp_rs["langid"]; } else { $_SESSION["sys_lang_id"] = defined("SYS_LANG") ? SYS_LANG : "zh"; } if(file_exists(ROOT_DATA."lang_".$_SESSION["sys_lang_id"].".php")) { include_once(ROOT_DATA."lang_".$_SESSION["sys_lang_id"].".php"); } } else { $_SESSION["sys_lang_id"] = defined("SYS_LANG") ? SYS_LANG : "zh"; $_lang = array(); } //指定语言包 $_lang = $APP->lang($_SESSION["sys_lang_id"],$_lang); $APP->langid = $_SESSION["sys_lang_id"]; //读取缓存信息 $APP->cache_lib->load_setting(); $APP->cache_lib->langid($_SESSION["sys_lang_id"]); $APP->cache_lib->cache_connect_server(); // 判断是否有tplconfig_m模块应用,有就重写新的模块 if($APP->tplconfig_m) { $_tmp_rs = $APP->tplconfig_m->get_one(0,$_SESSION["sys_lang_id"]); if($_tmp_rs && $_tmp_rs["folder"] != "default") { $APP->tpl->tplid = $_tmp_rs["id"]; $APP->tpl->tpldir = "tpl/".$_tmp_rs["folder"]; $APP->tpl->cache = ROOT."data/tpl_c"; $APP->tpl->ext = $_tmp_rs["ext"] ? $_tmp_rs["ext"] : "html"; $APP->tpl->autoimg = $_tmp_rs["autoimg"]; } unset($_tmp_rs); } //判断是否有使用配置信息 if($APP->setconfig_m && $_SESSION["sys_lang_id"]) { $_tmp_rs = $APP->setconfig_m->get_list($_SESSION["sys_lang_id"]); $APP->sys_config($_tmp_rs); $APP->tpl->assign("_sys",$_tmp_rs); //判断网站是否有关闭,如有关闭,则跳转到关闭页面 if(!$_tmp_rs["site_status"]) { $APP->tpl->display("close.".$APP->tpl->ext); exit(); } unset($_tmp_rs); } //模块ID与标识串的互换 if($APP->module_m) { $_tmp_rs = $APP->module_m->get_id_code_list(); if($_tmp_rs) { $APP->module_codelist = $_tmp_rs["code"]; $APP->module_idlist = $_tmp_rs["id"]; unset($_tmp_rs); } } //分类ID与标识符的互换 if($APP->cate_m) { $_tmp_rs = $APP->cate_m->get_id_code_list(); if($_tmp_rs) { $APP->cate_codelist = $_tmp_rs["code"]; $APP->cate_idlist = $_tmp_rs["id"]; unset($_tmp_rs); } } //加载核心参数 include_once(LIBS."phpok.sys.php"); $function_name = strtolower($p_f)."_f"; unset($p_c,$p_f,$p_d,$control_file); $APP->$function_name(); //更新缓存(这里主要是用于更新文本缓存) $APP->cache_lib->cache_write_txt(); ?>