/** * Tries to detect the base URI of this request and returns it. * * @param \F3\FLOW3\Property\DataType\Uri $requestUri URI of this web request * @return \F3\FLOW3\Property\DataType\Uri The detected base URI * @author Robert Lemke <*****@*****.**> */ protected function detectBaseUri(\F3\FLOW3\Property\DataType\Uri $requestUri) { $baseUri = clone $requestUri; $baseUri->setQuery(NULL); $baseUri->setFragment(NULL); $requestPathSegments = explode('/', $this->environment->getScriptRequestPathAndName()); array_pop($requestPathSegments); $baseUri->setPath(implode('/', $requestPathSegments) . '/'); return $baseUri; }
/** * 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)); }