/** * Handles a HTTP request * * @return void */ public function handleRequest() { // Create the request very early so the Resource Management has a chance to grab it: $this->request = Request::createFromEnvironment(); $this->response = new Response(); $this->boot(); $this->resolveDependencies(); if (isset($this->settings['http']['baseUri'])) { $this->request->setBaseUri(new Uri($this->settings['http']['baseUri'])); } $componentContext = new ComponentContext($this->request, $this->response); $this->baseComponentChain->handle($componentContext); $this->response->send(); $this->bootstrap->shutdown(Bootstrap::RUNLEVEL_RUNTIME); $this->exit->__invoke(); }
/** * @test */ public function getBaseUriReturnsThePresetBaseUriIfItHasBeenSet() { $server = array('HTTP_HOST' => 'dev.blog.rob', 'REQUEST_METHOD' => 'GET', 'REQUEST_URI' => '/foo/bar', 'SCRIPT_NAME' => '/index.php', 'PHP_SELF' => '/index.php'); $request = new Request(array(), array(), array(), $server); $baseUri = new \TYPO3\Flow\Http\Uri('http://prod.blog.rob/'); $request->setBaseUri($baseUri); $this->assertEquals('http://prod.blog.rob/', (string) $request->getBaseUri()); }