function __construct() { set_error_handler(array($this, 'ErrorCatcher')); $this->_config = $this->getDefaultSettings(); $this->_request = \App\Request::getInstance(); $this->_response = \App\Response::getInstance(); //$this->_route = \App\Route::getInstance(); $this->_logger = new \App\Log($this->_config['Logger']); }
/** * 获取查询参数 * * @param string $target * * @return array */ protected function get_params($target = "") { $request = Request::getInstance(); if ($target == "") { $controller = App::getController(true); $action = App::getAction(true); if ($action != 'index') { $target = $controller . '-' . $action; } else { $target = $controller; } } $params = $request->getQueryData(); $params = array_merge($params, $this->params); array_unshift($params, $target); return $params; }
/** * 获取请求对象 */ public function request() { return Request::getInstance(); }