getTraceAsString(),Log::ERR); } } } static public function fill_param() { foreach ($_GET as $key => $val) { unset($_GET[$key]); } foreach ($_POST as $key => $val) { unset($_POST[$key]); } $method = strtolower(request_helper::method()); $_GET['act'] = 'index'; $_GET['op'] = 'index'; if ($method == 'get') { $squery = request_helper::query_string(); } else { $squery = request_helper::content(); Log::record($squery); } if ($squery == '') { return; } else { $_SERVER['original_querystring'] = $squery; } $params = preg_split('/&|=/', $squery); if ($method == 'get' || $method == 'post') { for ($i = 0; $i < count($params); ++$i) { $key = $params[$i]; $val = $params[++$i]; $_GET[$key] = $val; $_POST[$key] = $val; } } } } function init_request() { request_helper::fill_server(); request_helper::fill_param(); } class local_request { private $script_file; private $query_string; private $method; public function __construct($uri) { $param = parse_url($uri); $this->script_file = BASE_ROOT_PATH . $param['path']; $this->query_string = $param['query']; $this->method = 'GET'; } public function script_file() { return $this->script_file; } public function query_string() { return $this->query_string; } public function method() { return $this->method; } } function init_localreq(local_request $req) { $squery = $req->query_string(); $params = preg_split('/&|=/', $squery); $method = strtolower($req->method()); if ($method == 'get' || $method == 'post') { for ($i = 0; $i < count($params); ++$i) { $key = $params[$i]; $val = $params[++$i]; $_GET[$key] = $val; $_POST[$key] = $val; } } }