PHP Class DmitryDulepov\Realurl\Configuration\ConfigurationReader

Author: Dmitry Dulepov ([email protected])
Inheritance: implements TYPO3\CMS\Core\SingletonInterface
Show file Open project: dmitryd/typo3-realurl Class Usage Examples

Protected Properties

Property Type Description
$alternativeHostName string
$configuration array
$defaultValues array Default values for some configuration options.
$domainConfiguration array | null
$exception Exception
$extConfiguration array
$getVarsToSet array
$hostName string
$mode integer
$urlParameters array
$utility DmitryDulepov\Realurl\Utility

Public Methods

Method Description
__construct ( integer $mode, array $urlParameters = [] ) Initializes the class.
get ( string $path ) : mixed Obtains the configuration by its path. Paths are separated by '/'.
getGetVarsToSet ( ) : array Returns _GET vars to set.
getMode ( ) : integer Returns the current mode.
validate ( ) If the configuration is invalid throws an exception stored earlier. This makes sense only we are have a speaking url.

Protected Methods

Method Description
getConfigurationKey ( ) : string Obtains the configuration key to use.
getConfigurationKeyByDomainDecode ( string $configurationKey ) : string Adjusts configration key for decoding.
getDefaultValue ( string $path ) : mixed Obtains the default value for the option.
getFromConfiguration ( string $path ) : mixed Obtains the value by path from the configuration.
loadExtConfiguration ( ) : void Loads extension configuration.
performAutomaticConfiguration ( ) : void Performs automatic configuration if necessary.
postProcessConfiguration ( ) : void Runs post-processing hooks for extensions.
resolveConfigurationKey ( string $keyAlias ) : string Resolves configuration aliases. For example: 'domain1' => 'domain2', 'domain2' => 'domain3', 'domain3' => array(.
setConfigurationForTheCurrentDomain ( ) : void Sets the configuration from the current domain.
setHostnames ( ) : void Sets host name variables.
setHostnamesForDecoding ( ) : void Sets host name variables for decoding.
setHostnamesForEncoding ( ) : void Sets host name variables for encoding.
setRootPageId ( ) : void Sets the root page id from the current host if that is not set already.
setRootPageIdFromDomainRecord ( ) : boolean Sets the root page id from domain records.
setRootPageIdFromRootFlag ( ) : boolean Sets the root page id from pages with the root flag.
setRootPageIdFromTopLevelPages ( ) : boolean Sets the root page id from the top level pages.
updateConfigurationForEncoding ( string &$configurationKey ) : void Updates _DOMAINS configuration to include only relevant entries and remove rootpage_id option.

Method Details

__construct() public method

Initializes the class.
public __construct ( integer $mode, array $urlParameters = [] )
$mode integer One of MODE_* constants
$urlParameters array

get() public method

Leading and trailing slashes are removed. Special use: 'extconf/xxx' gets the entry from the ext_conf_template.txt.
public get ( string $path ) : mixed
$path string
return mixed

getConfigurationKey() protected method

Obtains the configuration key to use.
protected getConfigurationKey ( ) : string
return string

getConfigurationKeyByDomainDecode() protected method

Adjusts configration key for decoding.
protected getConfigurationKeyByDomainDecode ( string $configurationKey ) : string
$configurationKey string
return string

getDefaultValue() protected method

Obtains the default value for the option.
protected getDefaultValue ( string $path ) : mixed
$path string
return mixed

getFromConfiguration() protected method

Obtains the value by path from the configuration.
See also: get()
protected getFromConfiguration ( string $path ) : mixed
$path string
return mixed

getGetVarsToSet() public method

Returns _GET vars to set.
public getGetVarsToSet ( ) : array
return array

getMode() public method

Returns the current mode.
public getMode ( ) : integer
return integer

loadExtConfiguration() protected method

Loads extension configuration.
protected loadExtConfiguration ( ) : void
return void

performAutomaticConfiguration() protected method

Performs automatic configuration if necessary.
protected performAutomaticConfiguration ( ) : void
return void

postProcessConfiguration() protected method

Runs post-processing hooks for extensions.
protected postProcessConfiguration ( ) : void
return void

resolveConfigurationKey() protected method

...) will resolve 'domain1' and 'domain2' to 'domain3'.
protected resolveConfigurationKey ( string $keyAlias ) : string
$keyAlias string
return string

setConfigurationForTheCurrentDomain() protected method

Sets the configuration from the current domain.

setHostnames() protected method

Sets host name variables.
protected setHostnames ( ) : void
return void

setHostnamesForDecoding() protected method

Sets host name variables for decoding.
protected setHostnamesForDecoding ( ) : void
return void

setHostnamesForEncoding() protected method

Sets host name variables for encoding.
protected setHostnamesForEncoding ( ) : void
return void

setRootPageId() protected method

Sets the root page id from the current host if that is not set already.
protected setRootPageId ( ) : void
return void

setRootPageIdFromDomainRecord() protected method

Sets the root page id from domain records.

setRootPageIdFromRootFlag() protected method

Sets the root page id from pages with the root flag.
protected setRootPageIdFromRootFlag ( ) : boolean
return boolean

setRootPageIdFromTopLevelPages() protected method

Sets the root page id from the top level pages.

updateConfigurationForEncoding() protected method

Updates _DOMAINS configuration to include only relevant entries and remove rootpage_id option.
protected updateConfigurationForEncoding ( string &$configurationKey ) : void
$configurationKey string
return void

validate() public method

This must be called once prior to using get() call.
public validate ( )

Property Details

$alternativeHostName protected property

protected string $alternativeHostName
return string

$configuration protected property

protected array $configuration
return array

$defaultValues protected property

Default values for some configuration options.
protected array $defaultValues
return array

$domainConfiguration protected property

protected array|null $domainConfiguration
return array | null

$exception protected property

protected Exception $exception
return Exception

$extConfiguration protected property

protected array $extConfiguration
return array

$getVarsToSet protected property

protected array $getVarsToSet
return array

$hostName protected property

protected string $hostName
return string

$mode protected property

protected int $mode
return integer

$urlParameters protected property

protected array $urlParameters
return array

$utility protected property

protected Utility,DmitryDulepov\Realurl $utility
return DmitryDulepov\Realurl\Utility