‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Http\NormalizedParams Class Reference

Public Member Functions

 __construct (array $serverParams, array $configuration, string $pathThisScript, string $pathSite)
 
string getHttpHost ()
 
bool isHttps ()
 
string getRequestHost ()
 
string getRequestHostOnly ()
 
int getRequestPort ()
 
string getScriptName ()
 
string getRequestUri ()
 
string getRequestUrl ()
 
string getRequestScript ()
 
string getRequestDir ()
 
bool isBehindReverseProxy ()
 
string getRemoteAddress ()
 
string getScriptFilename ()
 
string getDocumentRoot ()
 
string getSiteUrl ()
 
string getSitePath ()
 
string getSiteScript ()
 
string getPathInfo ()
 
string getHttpReferer ()
 
string getHttpUserAgent ()
 
string getHttpAcceptEncoding ()
 
string getHttpAcceptLanguage ()
 
string getRemoteHost ()
 
string getQueryString ()
 

Static Public Member Functions

static static createFromServerParams (array $serverParams, array $systemConfiguration=null)
 
static static createFromRequest (ServerRequestInterface $request, array $systemConfiguration=null)
 

Static Protected Member Functions

static string determineHttpHost (array $serverParams, array $configuration, bool $isBehindReverseProxy)
 
static bool determineHttps (array $serverParams, array $configuration)
 
static string determineScriptName (array $serverParams, array $configuration, bool $isHttps, bool $isBehindReverseProxy)
 
static string determineRequestUri (array $serverParams, array $configuration, bool $isHttps, string $scriptName, bool $isBehindReverseProxy)
 
static string determineRemoteAddress (array $serverParams, array $configuration, bool $isBehindReverseProxy)
 
static bool determineIsBehindReverseProxy ($serverParams, $configuration)
 
static string determineRequestHostOnly (string $httpHost)
 
static int determineRequestPort (string $httpHost, string $httpHostOnly)
 
static string determineDocumentRoot (string $scriptNameOnFileSystem, string $scriptFilename)
 
static string determineSiteUrl (string $requestDir, string $pathThisScript, string $pathSite)
 
static determineSitePath (string $requestHost, string $siteUrl)
 
static determineSiteScript (string $requestUrl, string $siteUrl)
 

Protected Attributes

string $httpHost = ''
 
bool $isHttps = false
 
string $requestHost = ''
 
string $requestHostOnly = ''
 
int $requestPort = 0
 
string $scriptName = ''
 
string $requestUri = ''
 
string $requestUrl = ''
 
string $requestScript = ''
 
string $requestDir = ''
 
bool $isBehindReverseProxy = false
 
string $remoteAddress = ''
 
string $scriptFilename = ''
 
string $documentRoot = ''
 
string $siteUrl = ''
 
string $sitePath = ''
 
string $siteScript = ''
 
string $pathInfo = ''
 
string $httpReferer = ''
 
string $httpUserAgent = ''
 
string $httpAcceptEncoding = ''
 
string $httpAcceptLanguage = ''
 
string $remoteHost = ''
 
string $queryString = ''
 

Static Private Member Functions

static encodeFileSystemPathComponentForUrlPath (string $path)
 

Detailed Description

This class provides normalized server parameters in HTTP request context. It normalizes reverse proxy scenarios and various other web server specific differences of the native PSR-7 request object parameters (->getServerParams() / $GLOBALS['_SERVER']).

An instance of this class is available as PSR-7 ServerRequestInterface attribute:

$normalizedParams = $request->getAttribute('normalizedParams')

This class substitutes the old GeneralUtility::getIndpEnv() method.

Definition at line 37 of file NormalizedParams.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Http\NormalizedParams::__construct ( array  $serverParams,
array  $configuration,
string  $pathThisScript,
string  $pathSite 
)

Constructor calculates all values by incoming variables.

This object is immutable.

All determine*() "detail worker methods" in this class retrieve their dependencies to other properties as method arguments, they are static, stateless and have no dependency to $this. This ensures the chain of inter-property dependencies is visible by only looking at the construct() method.

Parameters
array$serverParams,usually‪coming from $_SERVER or $request->getServerParams()
array$configuration‪$GLOBALS['TYPO3_CONF_VARS']['SYS']
string$pathThisScript‪Absolute server entry script path, usually found within Environment::getCurrentScript()
string$pathSite‪Absolute server path to document root, Environment::getPublicPath()

Definition at line 279 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$httpHost, TYPO3\CMS\Core\Http\NormalizedParams\$isBehindReverseProxy, TYPO3\CMS\Core\Http\NormalizedParams\$isHttps, TYPO3\CMS\Core\Http\NormalizedParams\$requestDir, TYPO3\CMS\Core\Http\NormalizedParams\$requestHost, TYPO3\CMS\Core\Http\NormalizedParams\$requestHostOnly, TYPO3\CMS\Core\Http\NormalizedParams\$requestUri, TYPO3\CMS\Core\Http\NormalizedParams\$requestUrl, TYPO3\CMS\Core\Http\NormalizedParams\$scriptFilename, TYPO3\CMS\Core\Http\NormalizedParams\$scriptName, TYPO3\CMS\Core\Http\NormalizedParams\$siteUrl, TYPO3\CMS\Core\Http\NormalizedParams\determineDocumentRoot(), TYPO3\CMS\Core\Http\NormalizedParams\determineHttpHost(), TYPO3\CMS\Core\Http\NormalizedParams\determineHttps(), TYPO3\CMS\Core\Http\NormalizedParams\determineIsBehindReverseProxy(), TYPO3\CMS\Core\Http\NormalizedParams\determineRemoteAddress(), TYPO3\CMS\Core\Http\NormalizedParams\determineRequestHostOnly(), TYPO3\CMS\Core\Http\NormalizedParams\determineRequestPort(), TYPO3\CMS\Core\Http\NormalizedParams\determineRequestUri(), TYPO3\CMS\Core\Http\NormalizedParams\determineScriptName(), TYPO3\CMS\Core\Http\NormalizedParams\determineSitePath(), TYPO3\CMS\Core\Http\NormalizedParams\determineSiteScript(), TYPO3\CMS\Core\Http\NormalizedParams\determineSiteUrl(), TYPO3\CMS\Core\Http\NormalizedParams\encodeFileSystemPathComponentForUrlPath(), TYPO3\CMS\Core\Http\NormalizedParams\isBehindReverseProxy(), and TYPO3\CMS\Core\Http\NormalizedParams\isHttps().

Member Function Documentation

◆ createFromRequest()

static static TYPO3\CMS\Core\Http\NormalizedParams::createFromRequest ( ServerRequestInterface  $request,
array  $systemConfiguration = null 
)
static

Factory method for creating normalized params from a PSR-7 server request object

Parameters
array | null$systemConfiguration
Returns
‪static

Definition at line 840 of file NormalizedParams.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Form\Mvc\Persistence\FormPersistenceManager\__construct(), TYPO3\CMS\Core\Authentication\AbstractUserAuthentication\appendCookieToResponse(), TYPO3\CMS\Backend\Command\ResetPasswordCommand\createFakeWebRequest(), TYPO3\CMS\Core\Session\UserSessionManager\createFromRequestOrAnonymous(), TYPO3\CMS\Core\RateLimiter\RateLimiterFactory\createLoginRateLimiter(), TYPO3\CMS\Core\Tests\Acceptance\Support\Extension\ApplicationEnvironment\createServerRequest(), TYPO3\CMS\Frontend\Tests\Unit\Controller\ErrorControllerTest\defaultErrorHandlerWithHtmlResponseIsChosenWhenNoSiteConfiguredForAccessDeniedAction(), TYPO3\CMS\Frontend\Tests\Unit\Controller\ErrorControllerTest\defaultErrorHandlerWithHtmlResponseIsChosenWhenNoSiteConfiguredForInternalErrorAction(), TYPO3\CMS\Frontend\Tests\Unit\Controller\ErrorControllerTest\defaultErrorHandlerWithHtmlResponseIsChosenWhenNoSiteConfiguredForPageNotFoundAction(), TYPO3\CMS\Frontend\Tests\Unit\Controller\ErrorControllerTest\defaultErrorHandlerWithHtmlResponseIsChosenWhenNoSiteConfiguredForUnavailableAction(), TYPO3\CMS\Frontend\Tests\Unit\Controller\ErrorControllerTest\defaultErrorHandlerWithJsonResponseIsChosenWhenNoSiteConfiguredForAccessDeniedAction(), TYPO3\CMS\Frontend\Tests\Unit\Controller\ErrorControllerTest\defaultErrorHandlerWithJsonResponseIsChosenWhenNoSiteConfiguredForInternalErrorAction(), TYPO3\CMS\Frontend\Tests\Unit\Controller\ErrorControllerTest\defaultErrorHandlerWithJsonResponseIsChosenWhenNoSiteConfiguredForPageNotFoundAction(), TYPO3\CMS\Frontend\Tests\Unit\Controller\ErrorControllerTest\defaultErrorHandlerWithJsonResponseIsChosenWhenNoSiteConfiguredForUnavailableAction(), TYPO3\CMS\Install\Controller\InstallerController\executeDefaultConfigurationAction(), TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder\forceAbsoluteUrl(), TYPO3\CMS\Core\Security\ContentSecurityPolicy\PolicyProvider\getDefaultReportingUriBase(), TYPO3\CMS\Core\Routing\BackendEntryPointResolver\getEntryPoint(), TYPO3\CMS\Core\Http\Application\getNormalizedParams(), TYPO3\CMS\Frontend\Tests\Functional\ContentObject\ContentObjectRendererTest\getPreparedRequest(), TYPO3\CMS\Core\Routing\BackendEntryPointResolver\getUriFromRequest(), TYPO3\CMS\Frontend\Tests\Unit\Controller\ErrorControllerTest\internalErrorHandlingDoesNotTriggerDueToDevIpMask(), TYPO3\CMS\Frontend\Tests\Unit\Controller\ErrorControllerTest\internalErrorHandlingReturns500ResponseIfNotConfigured(), TYPO3\CMS\FrontendLogin\Tests\Unit\Validation\RedirectUrlValidatorTest\isInCurrentDomainIgnoresScheme(), TYPO3\CMS\FrontendLogin\Tests\Unit\Validation\RedirectUrlValidatorTest\isInCurrentDomainReturnsFalseIfDomainsAreDifferent(), TYPO3\CMS\RteCKEditor\Tests\Functional\RecordList\Controller\BrowseLinksControllerTest\linkEventsAreTriggered(), TYPO3\CMS\Backend\Tests\Functional\Routing\RouterTest\matchResultFindsProperRoute(), TYPO3\CMS\Backend\Tests\Functional\Routing\RouterTest\matchResultReturnsRouteForBackendModuleWithMethodLimitation(), TYPO3\CMS\Backend\Tests\Functional\Routing\RouterTest\matchResultReturnsRouteForSubRoute(), TYPO3\CMS\Backend\Tests\Functional\Routing\RouterTest\matchResultReturnsRouteWithMethodLimitation(), TYPO3\CMS\Backend\Tests\Functional\Routing\RouterTest\matchResultReturnsRouteWithPlaceholderAndMethodLimitation(), TYPO3\CMS\Backend\Tests\Functional\Routing\RouterTest\matchResultThrowsExceptionForWrongHttpMethod(), TYPO3\CMS\Backend\Tests\Functional\Routing\RouterTest\matchResultThrowsExceptionOnInvalidRoute(), TYPO3\CMS\Backend\Tests\Functional\Routing\RouterTest\matchResultThrowsInvalidMethodForValidRoute(), TYPO3\CMS\Extbase\Tests\Functional\Mvc\Web\RequestBuilderTest\multipleUploadedFileCanBeRetrievedFromRequest(), TYPO3\CMS\Frontend\Tests\Unit\Controller\ErrorControllerTest\pageNotFoundHandlingReturns404ResponseIfNotConfigured(), TYPO3\CMS\Extbase\Tests\Functional\Mvc\Web\RequestBuilderTest\prepareServerRequest(), TYPO3\CMS\Core\Middleware\NormalizedParamsAttribute\process(), TYPO3\CMS\Backend\Authentication\PasswordReset\resetPassword(), TYPO3\CMS\Backend\Authentication\PasswordReset\sendAmbiguousEmail(), TYPO3\CMS\Backend\Authentication\PasswordReset\sendResetEmail(), TYPO3\CMS\IndexedSearch\Tests\Unit\IndexerTest\setUp(), TYPO3\CMS\FrontendLogin\Tests\Unit\Service\RecoveryServiceTest\setUp(), TYPO3\CMS\FrontendLogin\Tests\Unit\Validation\RedirectUrlValidatorTest\setUpFakeSitePathAndHost(), TYPO3\CMS\Frontend\Tests\Unit\Controller\ErrorControllerTest\unavailableHandlingDoesNotTriggerDueToDevIpMask(), TYPO3\CMS\Frontend\Tests\Unit\Controller\ErrorControllerTest\unavailableHandlingReturns503ResponseIfNotConfigured(), and TYPO3\CMS\Extbase\Tests\Functional\Mvc\Web\RequestBuilderTest\uploadedFileCanBeRetrievedFromRequest().

◆ createFromServerParams()

static static TYPO3\CMS\Core\Http\NormalizedParams::createFromServerParams ( array  $serverParams,
array  $systemConfiguration = null 
)
static

◆ determineDocumentRoot()

static string TYPO3\CMS\Core\Http\NormalizedParams::determineDocumentRoot ( string  $scriptNameOnFileSystem,
string  $scriptFilename 
)
staticprotected

Calculate absolute path to web document root

Parameters
string$scriptNameOnFileSystem‪Entry script path of URI on file system, without domain and without query parameters, with leading /
string$scriptFilename‪Absolute path to entry script on server filesystem
Returns
‪string Path to document root with trailing slash

Definition at line 757 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$scriptFilename.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct().

◆ determineHttpHost()

static string TYPO3\CMS\Core\Http\NormalizedParams::determineHttpHost ( array  $serverParams,
array  $configuration,
bool  $isBehindReverseProxy 
)
staticprotected

Normalize HTTP_HOST by taking proxy configuration into account.

Parameters
array$serverParams‪Basically the $_SERVER, but from $request object
array$configuration‪$TYPO3_CONF_VARS['SYS'] array
bool$isBehindReverseProxy‪True if reverse proxy setup is detected
Returns
‪string Normalized HTTP_HOST

Definition at line 543 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$httpHost, TYPO3\CMS\Core\Http\NormalizedParams\$isBehindReverseProxy, and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct().

◆ determineHttps()

static bool TYPO3\CMS\Core\Http\NormalizedParams::determineHttps ( array  $serverParams,
array  $configuration 
)
staticprotected

Determine if the client called via HTTPS. Takes proxy ssl terminator configurations into account.

Parameters
array$serverParams‪Basically the $_SERVER, but from $request object
array$configuration‪$TYPO3_CONF_VARS['SYS'] array
Returns
‪bool True if request has been done via HTTPS

Definition at line 583 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$isHttps, and TYPO3\CMS\Core\Utility\GeneralUtility\cmpIP().

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct().

◆ determineIsBehindReverseProxy()

static bool TYPO3\CMS\Core\Http\NormalizedParams::determineIsBehindReverseProxy (   $serverParams,
  $configuration 
)
staticprotected

Check if a configured reverse proxy setup is detected.

Parameters
array$serverParams‪Basically the $_SERVER, but from $request object
array$configuration‪$TYPO3_CONF_VARS[SYS] array
Returns
‪bool True if TYPO3 is behind a reverse proxy

Definition at line 713 of file NormalizedParams.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\cmpIP().

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct().

◆ determineRemoteAddress()

static string TYPO3\CMS\Core\Http\NormalizedParams::determineRemoteAddress ( array  $serverParams,
array  $configuration,
bool  $isBehindReverseProxy 
)
staticprotected

Determine clients REMOTE_ADDR, even if there is a reverse proxy in between.

Parameters
array$serverParams‪Basically the $_SERVER, but from $request object
array$configuration‪$TYPO3_CONF_VARS[SYS] array
bool$isBehindReverseProxy‪True if reverse proxy setup is detected
Returns
‪string Resolved REMOTE_ADDR

Definition at line 682 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$isBehindReverseProxy, TYPO3\CMS\Core\Http\NormalizedParams\$remoteAddress, TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode(), and TYPO3\CMS\Core\Utility\GeneralUtility\validIP().

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct().

◆ determineRequestHostOnly()

static string TYPO3\CMS\Core\Http\NormalizedParams::determineRequestHostOnly ( string  $httpHost)
staticprotected

HTTP_HOST without port

Parameters
string$httpHost‪host[:[port]]
Returns
‪string Resolved host

Definition at line 727 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$httpHost.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct().

◆ determineRequestPort()

static int TYPO3\CMS\Core\Http\NormalizedParams::determineRequestPort ( string  $httpHost,
string  $httpHostOnly 
)
staticprotected

Requested port if given

Parameters
string$httpHost‪host[:[port]]
string$httpHostOnly‪host
Returns
‪int Resolved port if given, else 0

Definition at line 745 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$httpHost.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct().

◆ determineRequestUri()

static string TYPO3\CMS\Core\Http\NormalizedParams::determineRequestUri ( array  $serverParams,
array  $configuration,
bool  $isHttps,
string  $scriptName,
bool  $isBehindReverseProxy 
)
staticprotected

Determine REQUEST_URI, taking proxy configuration and various web server specifics into account.

Parameters
array$serverParams‪Basically the $_SERVER, but from $request object
array$configuration‪$TYPO3_CONF_VARS['SYS'] array
bool$isHttps‪True if used protocol is HTTPS
string$scriptName‪Script name
bool$isBehindReverseProxy‪True if reverse proxy setup is detected
Returns
‪string Sanitized REQUEST_URI

Definition at line 640 of file NormalizedParams.php.

References $GLOBALS, TYPO3\CMS\Core\Http\NormalizedParams\$isBehindReverseProxy, TYPO3\CMS\Core\Http\NormalizedParams\$isHttps, TYPO3\CMS\Core\Http\NormalizedParams\$queryString, TYPO3\CMS\Core\Http\NormalizedParams\$requestUri, TYPO3\CMS\Core\Http\NormalizedParams\$scriptName, and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct().

◆ determineScriptName()

static string TYPO3\CMS\Core\Http\NormalizedParams::determineScriptName ( array  $serverParams,
array  $configuration,
bool  $isHttps,
bool  $isBehindReverseProxy 
)
staticprotected

Determine script name and path

Parameters
array$serverParams‪Basically the $_SERVER, but from $request object
array$configuration‪TYPO3_CONF_VARS['SYS'] array
bool$isHttps‪True if used protocol is HTTPS
bool$isBehindReverseProxy‪True if reverse proxy setup is detected
Returns
‪string Sanitized script name

Definition at line 611 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$isBehindReverseProxy, TYPO3\CMS\Core\Http\NormalizedParams\$isHttps, and TYPO3\CMS\Core\Http\NormalizedParams\$scriptName.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct().

◆ determineSitePath()

static TYPO3\CMS\Core\Http\NormalizedParams::determineSitePath ( string  $requestHost,
string  $siteUrl 
)
staticprotected

Determine site path

Parameters
string$requestHost‪scheme://host[:port]
string$siteUrl‪Full Frontend Url

Definition at line 804 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$requestHost, and TYPO3\CMS\Core\Http\NormalizedParams\$siteUrl.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct().

◆ determineSiteScript()

static TYPO3\CMS\Core\Http\NormalizedParams::determineSiteScript ( string  $requestUrl,
string  $siteUrl 
)
staticprotected

◆ determineSiteUrl()

static string TYPO3\CMS\Core\Http\NormalizedParams::determineSiteUrl ( string  $requestDir,
string  $pathThisScript,
string  $pathSite 
)
staticprotected

Determine frontend url

Parameters
string$requestDir‪Full Uri with path, but without script name and query parts
string$pathThisScript‪Absolute path to entry script on server filesystem
string$pathSite‪Absolute server path to document root
Returns
‪string Calculated Frontend Url

Definition at line 790 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$requestDir, and TYPO3\CMS\Core\Http\NormalizedParams\$siteUrl.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct().

◆ encodeFileSystemPathComponentForUrlPath()

static TYPO3\CMS\Core\Http\NormalizedParams::encodeFileSystemPathComponentForUrlPath ( string  $path)
staticprivate

◆ getDocumentRoot()

string TYPO3\CMS\Core\Http\NormalizedParams::getDocumentRoot ( )
Returns
‪string Absolute path to web document root, eg. /var/www/typo3

Definition at line 436 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$documentRoot.

◆ getHttpAcceptEncoding()

string TYPO3\CMS\Core\Http\NormalizedParams::getHttpAcceptEncoding ( )

Will be deprecated later, use $request->getServerParams()['HTTP_ACCEPT_ENCODING'] instead

Returns
‪string HTTP_ACCEPT_ENCODING, eg. 'gzip, deflate'

Definition at line 500 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$httpAcceptEncoding.

◆ getHttpAcceptLanguage()

string TYPO3\CMS\Core\Http\NormalizedParams::getHttpAcceptLanguage ( )

Will be deprecated later, use $request->getServerParams()['HTTP_ACCEPT_LANGUAGE'] instead

Returns
‪string HTTP_ACCEPT_LANGUAGE, eg. 'de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7'

Definition at line 510 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$httpAcceptLanguage.

◆ getHttpHost()

string TYPO3\CMS\Core\Http\NormalizedParams::getHttpHost ( )
Returns
‪string Sanitized HTTP_HOST value host[:port]

Definition at line 332 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$httpHost.

◆ getHttpReferer()

string TYPO3\CMS\Core\Http\NormalizedParams::getHttpReferer ( )

Will be deprecated later, use $request->getServerParams()['HTTP_REFERER'] instead

Returns
‪string HTTP_REFERER, eg. 'https://www.domain.com/typo3/index.php?id=42'

Definition at line 480 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$httpReferer.

◆ getHttpUserAgent()

string TYPO3\CMS\Core\Http\NormalizedParams::getHttpUserAgent ( )

Will be deprecated later, use $request->getServerParams()['HTTP_USER_AGENT'] instead

Returns
‪string HTTP_USER_AGENT identifier

Definition at line 490 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$httpUserAgent.

◆ getPathInfo()

string TYPO3\CMS\Core\Http\NormalizedParams::getPathInfo ( )

Will be deprecated later, use getScriptName() as reliable solution instead

Returns
‪string Script path part of URI, eg. 'typo3/index.php'

Definition at line 470 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$pathInfo.

◆ getQueryString()

string TYPO3\CMS\Core\Http\NormalizedParams::getQueryString ( )

Will be deprecated later, use $request->getServerParams()['QUERY_STRING'] instead

Returns
‪string QUERY_STRING, eg 'id=42&foo=bar'

Definition at line 530 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$queryString.

◆ getRemoteAddress()

string TYPO3\CMS\Core\Http\NormalizedParams::getRemoteAddress ( )

◆ getRemoteHost()

string TYPO3\CMS\Core\Http\NormalizedParams::getRemoteHost ( )

Will be deprecated later, use $request->getServerParams()['REMOTE_HOST'] instead

Returns
‪string REMOTE_HOST if configured in web server, eg. 'www.clientDomain.com'

Definition at line 520 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$remoteHost.

◆ getRequestDir()

string TYPO3\CMS\Core\Http\NormalizedParams::getRequestDir ( )
Returns
‪string REQUEST URI without script file name and query parts, eg. http://www.domain.com/typo3/

Definition at line 404 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$requestDir.

◆ getRequestHost()

string TYPO3\CMS\Core\Http\NormalizedParams::getRequestHost ( )
Returns
‪string Sanitized HTTP_HOST with protocol scheme://host[:port], eg. https://www.domain.com/

Definition at line 348 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$requestHost.

◆ getRequestHostOnly()

string TYPO3\CMS\Core\Http\NormalizedParams::getRequestHostOnly ( )
Returns
‪string Host / domain /IP only, eg. www.domain.com

Definition at line 356 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$requestHostOnly.

Referenced by TYPO3\CMS\Core\Http\CookieScopeTrait\getCookieScope().

◆ getRequestPort()

int TYPO3\CMS\Core\Http\NormalizedParams::getRequestPort ( )
Returns
‪int Requested port if given, eg. 8080 - often not explicitly given, then 0

Definition at line 364 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$requestPort.

◆ getRequestScript()

string TYPO3\CMS\Core\Http\NormalizedParams::getRequestScript ( )
Returns
‪string REQUEST URI without query part, eg. http://www.domain.com/typo3/index.php

Definition at line 396 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$requestScript.

◆ getRequestUri()

string TYPO3\CMS\Core\Http\NormalizedParams::getRequestUri ( )
Returns
‪string Request Uri without domain and protocol, eg. /index.php?id=42

Definition at line 380 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$requestUri.

◆ getRequestUrl()

string TYPO3\CMS\Core\Http\NormalizedParams::getRequestUrl ( )
Returns
‪string Full REQUEST_URI, eg. http://www.domain.com/typo3/foo/bar?id=42

Definition at line 388 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$requestUrl.

◆ getScriptFilename()

string TYPO3\CMS\Core\Http\NormalizedParams::getScriptFilename ( )
Returns
‪string Absolute entry script path on server, eg. /var/www/typo3/index.php

Definition at line 428 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$scriptFilename.

◆ getScriptName()

string TYPO3\CMS\Core\Http\NormalizedParams::getScriptName ( )
Returns
‪string Script path part of URI, eg. '/typo3/index.php'

Definition at line 372 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$scriptName.

◆ getSitePath()

string TYPO3\CMS\Core\Http\NormalizedParams::getSitePath ( )
Returns
‪string Path part to frontend, eg. /some/sub/dir/

Definition at line 452 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$sitePath.

Referenced by TYPO3\CMS\Workspaces\Middleware\WorkspacePreview\addCookie(), and TYPO3\CMS\Core\Http\CookieScopeTrait\getCookieScope().

◆ getSiteScript()

string TYPO3\CMS\Core\Http\NormalizedParams::getSiteScript ( )
Returns
‪string Path part to entry script with parameters, without sub dir, eg 'typo3/index.php?id=42'

Definition at line 460 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$siteScript.

◆ getSiteUrl()

string TYPO3\CMS\Core\Http\NormalizedParams::getSiteUrl ( )
Returns
‪string Website frontend url, eg. https://www.domain.com/some/sub/dir/

Definition at line 444 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$siteUrl.

◆ isBehindReverseProxy()

bool TYPO3\CMS\Core\Http\NormalizedParams::isBehindReverseProxy ( )
Returns
‪bool True if request comes from a configured reverse proxy

Definition at line 412 of file NormalizedParams.php.

References TYPO3\CMS\Core\Http\NormalizedParams\$isBehindReverseProxy.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct().

◆ isHttps()

Member Data Documentation

◆ $documentRoot

string TYPO3\CMS\Core\Http\NormalizedParams::$documentRoot = ''
protected

Absolute server path to web document root without trailing slash

  • ‪/var/www

Definition at line 162 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\getDocumentRoot().

◆ $httpAcceptEncoding

string TYPO3\CMS\Core\Http\NormalizedParams::$httpAcceptEncoding = ''
protected

HTTP_ACCEPT_ENCODING Will be deprecated later, use $request->getServerParams()['HTTP_ACCEPT_ENCODING'] instead

  • ‪gzip, deflate

Definition at line 233 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\getHttpAcceptEncoding().

◆ $httpAcceptLanguage

string TYPO3\CMS\Core\Http\NormalizedParams::$httpAcceptLanguage = ''
protected

HTTP_ACCEPT_LANGUAGE Will be deprecated later, use $request->getServerParams()['HTTP_ACCEPT_LANGUAGE'] instead

  • ‪de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7

Definition at line 242 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\getHttpAcceptLanguage().

◆ $httpHost

string TYPO3\CMS\Core\Http\NormalizedParams::$httpHost = ''
protected

◆ $httpReferer

string TYPO3\CMS\Core\Http\NormalizedParams::$httpReferer = ''
protected

HTTP_REFERER Will be deprecated later, use $request->getServerParams()['HTTP_REFERER'] instead

scheme://host[:[port]][path]

Definition at line 215 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\getHttpReferer().

◆ $httpUserAgent

string TYPO3\CMS\Core\Http\NormalizedParams::$httpUserAgent = ''
protected

HTTP_USER_AGENT Will be deprecated later, use $request->getServerParams()['HTTP_USER_AGENT'] instead

  • ‪Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36

Definition at line 224 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\getHttpUserAgent().

◆ $isBehindReverseProxy

◆ $isHttps

◆ $pathInfo

string TYPO3\CMS\Core\Http\NormalizedParams::$pathInfo = ''
protected

Entry script path of URI, without domain and without query parameters, with leading / This is often not set at all. Will be deprecated later, use $scriptName instead as more reliable solution.

[path_script]

Definition at line 204 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\getPathInfo().

◆ $queryString

string TYPO3\CMS\Core\Http\NormalizedParams::$queryString = ''
protected

QUERY_STRING Will be deprecated later, use $request->getServerParams()['QUERY_STRING'] instead

[query]

  • ‪id=42&foo=bar

Definition at line 262 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\determineRequestUri(), and TYPO3\CMS\Core\Http\NormalizedParams\getQueryString().

◆ $remoteAddress

string TYPO3\CMS\Core\Http\NormalizedParams::$remoteAddress = ''
protected

IPv4 or IPv6 address of remote client with resolved proxy setup

Definition at line 145 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\determineRemoteAddress(), and TYPO3\CMS\Core\Http\NormalizedParams\getRemoteAddress().

◆ $remoteHost

string TYPO3\CMS\Core\Http\NormalizedParams::$remoteHost = ''
protected

REMOTE_HOST Resolved host name of REMOTE_ADDR if configured in web server Will be deprecated later, use $request->getServerParams()['REMOTE_HOST'] instead

  • ‪www.clientDomain.com

Definition at line 251 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\getRemoteHost().

◆ $requestDir

string TYPO3\CMS\Core\Http\NormalizedParams::$requestDir = ''
protected

◆ $requestHost

string TYPO3\CMS\Core\Http\NormalizedParams::$requestHost = ''
protected

◆ $requestHostOnly

string TYPO3\CMS\Core\Http\NormalizedParams::$requestHostOnly = ''
protected

Host / domain part of HTTP_HOST, no port, no protocol

  • ‪www.domain.com
  • 192.168.1.42

Definition at line 72 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct(), and TYPO3\CMS\Core\Http\NormalizedParams\getRequestHostOnly().

◆ $requestPort

int TYPO3\CMS\Core\Http\NormalizedParams::$requestPort = 0
protected

Port of HTTP_HOST if given

Definition at line 78 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\getRequestPort().

◆ $requestScript

string TYPO3\CMS\Core\Http\NormalizedParams::$requestScript = ''
protected

REQUEST URI with scheme, host, port and path, but without query part

scheme://host[:[port]][path_script]

Definition at line 122 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\getRequestScript().

◆ $requestUri

string TYPO3\CMS\Core\Http\NormalizedParams::$requestUri = ''
protected

REQUEST URI without domain and scheme, with trailing slash

[path][?[query]]

  • ‪/some/path?p1=parameter1&p2[key]=value
  • ‪/typo3/some/path?p1=parameter1&p2[key]=value

Definition at line 100 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct(), TYPO3\CMS\Core\Http\NormalizedParams\determineRequestUri(), and TYPO3\CMS\Core\Http\NormalizedParams\getRequestUri().

◆ $requestUrl

string TYPO3\CMS\Core\Http\NormalizedParams::$requestUrl = ''
protected

◆ $scriptFilename

string TYPO3\CMS\Core\Http\NormalizedParams::$scriptFilename = ''
protected

Absolute server path to entry script on server filesystem

  • ‪/var/www/index.php
  • ‪/var/www/typo3/index.php

Definition at line 154 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct(), TYPO3\CMS\Core\Http\NormalizedParams\determineDocumentRoot(), and TYPO3\CMS\Core\Http\NormalizedParams\getScriptFilename().

◆ $scriptName

string TYPO3\CMS\Core\Http\NormalizedParams::$scriptName = ''
protected

Entry script path of URI, without domain and without query parameters, with leading /

[path_script]

  • ‪/index.php
  • ‪/typo3/index.php

Definition at line 89 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\__construct(), TYPO3\CMS\Core\Http\NormalizedParams\determineRequestUri(), TYPO3\CMS\Core\Http\NormalizedParams\determineScriptName(), and TYPO3\CMS\Core\Http\NormalizedParams\getScriptName().

◆ $sitePath

string TYPO3\CMS\Core\Http\NormalizedParams::$sitePath = ''
protected

Path part to frontend, no domain, no protocol

  • /
  • ‪/some/sub/dir/

Definition at line 184 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\getSitePath().

◆ $siteScript

string TYPO3\CMS\Core\Http\NormalizedParams::$siteScript = ''
protected

Path to script, without sub path if TYPO3 is running in sub directory, without trailing slash

  • index.php?id=42
  • ‪/some/path?id=42
  • ‪typo3/some/path?id=411

Definition at line 194 of file NormalizedParams.php.

Referenced by TYPO3\CMS\Core\Http\NormalizedParams\getSiteScript().

◆ $siteUrl

string TYPO3\CMS\Core\Http\NormalizedParams::$siteUrl = ''
protected