init_sdf($app_id, $model, $realfile); }elseif($ext=='php' && $model=='setting'){ $setting = include($realfile); $this->init_setting($app_id, $setting); } } } closedir($handle); } }//End Function /** * 初始化_setting * @param mixed $app_id ID * @param mixed $setting setting * @return mixed 返回值 */ public function init_setting($app_id, $setting) { $app = app::get($app_id); if(is_array($setting)){ foreach($setting AS $key=>$value){ $app->setConf($key, $value); } } }//End Function /** * 初始化_sdf * @param mixed $app_id ID * @param mixed $model model * @param mixed $file file * @return mixed 返回值 */ public function init_sdf($app_id, $model, $file) { $handle = fopen($file, 'r'); if($handle){ while(!feof($handle)){ $buffer .= fgets($handle); if(!($sdf = unserialize($buffer))){ continue; } app::get($app_id)->model($model)->db_save($sdf); $buffer = ''; } fclose($handle); } }//End Function }//End Class