/**
  * Builds a web request object from the raw HTTP information
  *
  * @return \F3\FLOW3\MVC\Web\Request The web request as an object
  * @author Robert Lemke <*****@*****.**>
  * @author Bastian Waidelich <*****@*****.**>
  */
 public function build()
 {
     $request = $this->objectFactory->create('F3\\FLOW3\\MVC\\Web\\Request');
     $request->injectEnvironment($this->environment);
     $request->setRequestUri($this->environment->getRequestUri());
     $request->setMethod($this->environment->getRequestMethod());
     $this->setArgumentsFromRawRequestData($request);
     $routesConfiguration = $this->configurationManager->getConfiguration(\F3\FLOW3\Configuration\ConfigurationManager::CONFIGURATION_TYPE_ROUTES);
     $this->router->setRoutesConfiguration($routesConfiguration);
     $this->router->route($request);
     return $request;
 }
 /**
  * Detects the (resources) base URI and stores it as a protected
  * class variable.
  *
  * This functionality somewhat duplicates the detection used in the Web
  * Request Builder but for the time being this should be good enough.
  *
  * $this->resourcesPublishingPath must be set prior to calling this method.
  *
  * @return void
  * @author Robert Lemke <*****@*****.**>
  */
 protected function detectResourcesBaseUri()
 {
     $uri = $this->environment->getRequestUri();
     if ($uri === FALSE) {
         return;
     }
     $uri->setQuery(NULL);
     $uri->setFragment(NULL);
     $requestPathSegments = explode('/', $this->environment->getScriptRequestPathAndName());
     array_pop($requestPathSegments);
     $uri->setPath(implode('/', $requestPathSegments) . '/');
     $this->resourcesBaseUri = $uri . substr($this->resourcesPublishingPath, strlen(FLOW3_PATH_WEB));
 }