setExFiles($exfiles); } static private $stInstance = NULL; static public function instance() { if(self::$stInstance == NULL) { self::$stInstance = new RAccServer(); } return self::$stInstance; } protected function is_exclude($file) { $exister = function ($file, $subex) { $path = BASE_PATH . $subex; $dir = dirname($file); return ($path == $dir); }; $ret = parent::is_exclude($file); if ($ret) { return true; } global $config; $exclude_dirs = $config['access_include_dirs']; foreach ($exclude_dirs as $dir) { if($exister($file,$dir)) { return true; } } return false; } function handle_request($file) { try { fcgi_header("Content-Type: text/html; charset=UTF-8"); if(file_exists($file)) { if ($this->isIndex($file)) { Base::mobile_control(); } elseif ($this->is_exclude($file)) { Log::record("call-file = $file", Log::DEBUG); include $file; } else { echo "You cannot access this file."; } } else { echo "no such file."; } } catch (UnSignException $ex) { joutput_error(errcode::ErrSignParamter,errcode::msg(errcode::ErrSignParamter)); } catch (Exception $ex) { joutput_error($ex->getCode(),'异常错误'); Log::record("run_looper exception catch code={$ex->getCode()} msg={$ex->getMessage()} trace={$ex->getTraceAsString()}", Log::ERR); } } }