protected function buildGlobalEnvironment()
    {
        $request = clone $this;
        
        $request->serverParams =& $_SERVER;
        $request->cookies =& $_COOKIE;
        $request->queryParams =& $_GET;
        
        $request->setPostData($_POST);
        $request->setUploadedFiles($_FILES);
        
        $request->body = Stream::open('php://input', 'r');
        
        $request->reset();
        
        $request->isStale = false;
        
        return $request;
    }