96 private $distroBaseUrl;
101 private $pathInfoService;
142 if (empty($this->originalPathInfo)) {
143 $originalPathInfoFromRequest = $this->pathInfoService->getPathInfo(
144 $this->getRequestUri(),
147 $this->originalPathInfo = (string)$this->pathInfoProcessor->process($this, $originalPathInfoFromRequest);
148 $this->requestString = $this->originalPathInfo
149 . $this->pathInfoService->getQueryString($this->getRequestUri());
161 if (empty($this->pathInfo)) {
191 return isset($this->directFrontNames[
$code]);
201 $path = parent::getBasePath();
217 $pathParts = explode(
'/', trim($this->
getPathInfo(),
'/'));
218 return reset($pathParts);
255 $this->controllerModule =
$module;
276 if (empty($this->beforeForwardInfo)) {
277 $this->beforeForwardInfo = [
298 if (
$name ===
null) {
300 }
elseif (isset($this->beforeForwardInfo[
$name])) {
301 return $this->beforeForwardInfo[
$name];
313 if ($this->isXmlHttpRequest()) {
331 if ($this->distroBaseUrl) {
332 return $this->distroBaseUrl;
334 $headerHttpHost = $this->getServer(
'HTTP_HOST');
335 $headerHttpHost = $this->converter->cleanString($headerHttpHost);
336 $headerScriptName = $this->getServer(
'SCRIPT_NAME');
338 if (isset($headerScriptName) && isset($headerHttpHost)) {
340 $scheme =
'https://';
345 $hostArr = explode(
':', $headerHttpHost);
347 $port = isset($hostArr[1])
348 && (!$secure && $hostArr[1] != 80 || $secure && $hostArr[1] != 443) ?
':' . $hostArr[1] :
'';
351 return $this->distroBaseUrl = $scheme . $host . $port . rtrim(
$path,
'/') .
'/';
353 return 'http://localhost/';
365 if (isset($server[
'SCRIPT_NAME'])) {
366 $envPath = str_replace(
'\\',
'/', dirname(str_replace(
'\\',
'/', $server[
'SCRIPT_NAME'])));
367 if ($envPath !=
'.' && $envPath !=
'/') {
371 if (!preg_match(
'/\/$/',
$result)) {
385 if (!isset($_SERVER[
'SCRIPT_NAME'])) {
389 if ((
$pos = strripos(
$url, basename($_SERVER[
'SCRIPT_NAME']))) !==
false) {
427 if (isset($_SERVER[
'REQUEST_METHOD']) && (in_array($_SERVER[
'REQUEST_METHOD'], $this->safeRequestTypes))) {
static getDistroBaseUrlPath($server)
elseif(isset( $params[ 'redirect_parent']))
getParam($key, $default=null)
const XML_PATH_OFFLOADER_HEADER
isDirectAccessFrontendName($code)
getFullActionName($delimiter='_')
setControllerModule($module)
getBeforeForwardInfo($name=null)
__construct(CookieReaderInterface $cookieReader, StringUtils $converter, ConfigInterface $routeConfig, PathInfoProcessorInterface $pathInfoProcessor, ObjectManagerInterface $objectManager, $uri=null, $directFrontNames=[], PathInfo $pathInfoService=null)
setPathInfo($pathInfo=null)
static getUrlNoScript($url)
if(!isset($_GET['name'])) $name