PHP 클래스 DmitryDulepov\Realurl\Encoder\UrlEncoder

저자: Dmitry Dulepov ([email protected])
상속: extends DmitryDulepov\Realurl\EncodeDecoderBase
파일 보기 프로젝트 열기: dmitryd/typo3-realurl

보호된 프로퍼티들

프로퍼티 타입 설명
$encodedUrl string
$encoderParameters array
$originalUrl string This is the URL with sorted GET parameters. It is used for cache manipulation.
$originalUrlParameters array
$pageRepository TYPO3\CMS\Frontend\Page\PageRepository
$sysLanguageUid integer
$urlParameters array
$urlPrepend string
$urlPrependRegister array
$urlToEncode string
$usedAliases array

공개 메소드들

메소드 설명
__construct ( ) Initializes the class.
cleanUpAlias ( array $configuration, string $newAliasValue ) : string Cleans up the alias
encodeUrl ( array &$encoderParameters ) : void Entry point for the URL encoder.
getConfiguration ( ) : ConfigurationReader Returns the configuration reader. This can be used in hooks.
getOriginalUrlParameters ( ) : array Returns a coipy of original url parameters. This can be used in hooks.
getUtility ( ) : Utility Returns $this->utility. This can be used in hooks.
postProcessEncodedUrl ( array &$parameters, TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $pObj ) : void Post-processes the URL. If necessary prepends another domain to the URL.

보호된 메소드들

메소드 설명
addRemainingUrlParameters ( ) : void Adds remaining parameters to the generated URL. Note: parameters that are ignored by the 'cache/ignoredGetParametersRegExp' configuration option are not considered here!
addToPathCache ( string $pagePath ) : void Adds an entry to the path cache.
appendToEncodedUrl ( string $stringToAppend, boolean $addSlash = TRUE ) : void Appends a string to $this->encodedUrl properly handling slashes in between.
callPostEncodeHooks ( ) Calls user-defined hooks after encoding
canCacheUrl ( string $url ) : boolean Checks if the URL can be cached. This function may prevent RealURL cache pollution with Solr or Indexed search URLs. Also some doktypes are ignored for the cache.
canEncoderExecute ( ) : boolean Checks if RealURL can encode URLs.
checkForAllEmptySegments ( array &$segments ) : void Checks if all segments are empty and makes the empty array in such case.
createAliasForValue ( string $getVarValue, array $configuration ) : string Converts value to the alias
createPathComponent ( ) : void Creates a path part of the URL.
createPathComponentThroughOverride ( ) : boolean Checks if tx_realurl_pathoverride is set and goes the easy way.
createPathComponentUsingRootline ( ) : void Creates a path part of the URL.
createUniqueAlias ( array $configuration, $newAliasValue, $idValue ) : string Creates a unique alias.
encodeFixedPostVars ( ) : void Encodes fixed postVars.
encodePathComponents ( ) : void Encodes the path to the page.
encodePostVarSets ( ) : void Encodes 'postVarSets' into URL segments.
encodePreVars ( ) : void Encodes 'preVars' into URL segments.
encodeSingleVariable ( array $configuration, string &$previousValue, array &$segments ) Encodes a single variable for xxxVars.
encodeUrlParameterBlock ( array $configurationArray ) : string Encodes pre- or postVars according to the given configuration.
encodeUrlParameterBlockUseAsIs ( string $getVarName, string $getVarValue, array $configuration, array &$segments, string &$previousValue ) : boolean Just sets the value to the segment as is.
encodeUrlParameterBlockUsingLookupTable ( string $getVarName, string $getVarValue, array $configuration, array &$segments, string &$previousValue ) : boolean Uses lookUpMap to set the segment.
encodeUrlParameterBlockUsingNoMatch ( string $getVarName, string $getVarValue, array $configuration, array &$segments, string &$previousValue ) : boolean Uses 'noMatch' options to set the segment.
encodeUrlParameterBlockUsingUserFunc ( string $getVarName, string $getVarValue, array $configuration, array &$segments, string &$previousValue ) : boolean Calls the userFunc for the value to get the segment.
encodeUrlParameterBlockUsingValueDefault ( string $getVarName, string $getVarValue, array $configuration, array &$segments, string &$previousValue ) : boolean Just sets the default value to the segment.
encodeUrlParameterBlockUsingValueMap ( string $getVarName, string $getVarValue, array $configuration, array &$segments, string &$previousValue ) : boolean Uses the value map to determine the segment value.
executeEncoder ( ) : void Encodes the URL.
fetchFromUrlCache ( ) : boolean Attempts to fetch the speaking URL from the url cache.
fixEmptySegments ( array &$segments ) Changes empty segments to the value of $this->emptySegmentValue.
fixPageId ( ) Fixes page id if it is not a direct numeric page id.
getFromAliasCache ( array $configuration, string $getVarValue, integer $languageUid, string $onlyThisAlias = '' ) : string | null Obtains the value from the alias cache.
handleFileName ( ) : void Appends file name and suffix if necessary.
handleFileNameSetDefaultSuffix ( ) : void Sets the default suffix to the URL if configured so.
handleFileNameUsingGetVars ( ) : boolean Checks if the file name like 'rss.xml' should be produced according to _GET vars.
hasUrlParameters ( array $configurationArray ) : boolean Checks if any GETvar from the parameter block is present in $this->urlParameters.
initializeConfiguration ( ) Initializes configuration reader.
initializeUrlPrepend ( ) : void Checks if we should prpend URL according to _DOMAINS configuration.
isProperTsfe ( ) : boolean Checks if TSFE is initialized correctly.
isRealURLEnabled ( ) : boolean Checks if RealURL is enabled.
isSimulateStaticEnabled ( ) : boolean Checks if simulatestatic is enabled.
isTypo3Url ( ) : boolean Checks if a TYPO3 URL is going to be encoded.
parseUrlParameters ( ) : void Parses query string to a set of key/value inside $this->urlParameters.
prepareUrlPrepend ( ) : void Prepares the URL to use with _DOMAINS configuration.
reapplyAbsRefPrefix ( ) : void Reapplies absRefPrefix if necessary.
removeIgnoredUrlParameters ( ) Removes ignored parameters from various members.
removeIgnoredUrlParametersFromArray ( array $urlParameters ) : array Removes ignored URL parameters from the parameter list.
setLanguage ( ) : void Sets language for the encoder either from the URl or from the TSFE.
storeAliasToUrlCacheMapping ( string $urlCacheId ) : void Stores mapping between used aliases and url cache id. This information is used in the DataHandle hook to clear URl cache when record are renamed (= aliases change).
storeInAliasCache ( array $configuration, string $newAliasValue, string $idValue, integer $languageUid ) : string Adds the value to the alias cache.
storeInUrlCache ( ) : void Stores data in the URL cache.
trimMultipleSlashes ( ) Removes multiple slashes at the end of the encoded URL.

메소드 상세

__construct() 공개 메소드

Initializes the class.
public __construct ( )

addRemainingUrlParameters() 보호된 메소드

Adds remaining parameters to the generated URL. Note: parameters that are ignored by the 'cache/ignoredGetParametersRegExp' configuration option are not considered here!
protected addRemainingUrlParameters ( ) : void
리턴 void

addToPathCache() 보호된 메소드

Adds an entry to the path cache.
protected addToPathCache ( string $pagePath ) : void
$pagePath string
리턴 void

appendToEncodedUrl() 보호된 메소드

Appends a string to $this->encodedUrl properly handling slashes in between.
protected appendToEncodedUrl ( string $stringToAppend, boolean $addSlash = TRUE ) : void
$stringToAppend string
$addSlash boolean
리턴 void

callPostEncodeHooks() 보호된 메소드

Calls user-defined hooks after encoding
protected callPostEncodeHooks ( )

canCacheUrl() 보호된 메소드

Checks if the URL can be cached. This function may prevent RealURL cache pollution with Solr or Indexed search URLs. Also some doktypes are ignored for the cache.
protected canCacheUrl ( string $url ) : boolean
$url string
리턴 boolean

canEncoderExecute() 보호된 메소드

Checks if RealURL can encode URLs.
protected canEncoderExecute ( ) : boolean
리턴 boolean

checkForAllEmptySegments() 보호된 메소드

Checks if all segments are empty and makes the empty array in such case.
protected checkForAllEmptySegments ( array &$segments ) : void
$segments array
리턴 void

cleanUpAlias() 공개 메소드

Cleans up the alias
public cleanUpAlias ( array $configuration, string $newAliasValue ) : string
$configuration array Configuration array
$newAliasValue string Alias value to clean up
리턴 string

createAliasForValue() 보호된 메소드

Converts value to the alias
protected createAliasForValue ( string $getVarValue, array $configuration ) : string
$getVarValue string
$configuration array 'lookUpTable' configuration
리턴 string

createPathComponent() 보호된 메소드

Creates a path part of the URL.
protected createPathComponent ( ) : void
리턴 void

createPathComponentThroughOverride() 보호된 메소드

Checks if tx_realurl_pathoverride is set and goes the easy way.

createPathComponentUsingRootline() 보호된 메소드

Creates a path part of the URL.
protected createPathComponentUsingRootline ( ) : void
리턴 void

createUniqueAlias() 보호된 메소드

Creates a unique alias.
protected createUniqueAlias ( array $configuration, $newAliasValue, $idValue ) : string
$configuration array
$newAliasValue
$idValue
리턴 string

encodeFixedPostVars() 보호된 메소드

Encodes fixed postVars.
protected encodeFixedPostVars ( ) : void
리턴 void

encodePathComponents() 보호된 메소드

Encodes the path to the page.
protected encodePathComponents ( ) : void
리턴 void

encodePostVarSets() 보호된 메소드

Encodes 'postVarSets' into URL segments.
protected encodePostVarSets ( ) : void
리턴 void

encodePreVars() 보호된 메소드

Encodes 'preVars' into URL segments.
protected encodePreVars ( ) : void
리턴 void

encodeSingleVariable() 보호된 메소드

Encodes a single variable for xxxVars.
protected encodeSingleVariable ( array $configuration, string &$previousValue, array &$segments )
$configuration array
$previousValue string
$segments array

encodeUrl() 공개 메소드

Entry point for the URL encoder.
public encodeUrl ( array &$encoderParameters ) : void
$encoderParameters array
리턴 void

encodeUrlParameterBlock() 보호된 메소드

Encodes pre- or postVars according to the given configuration.
protected encodeUrlParameterBlock ( array $configurationArray ) : string
$configurationArray array
리턴 string

encodeUrlParameterBlockUseAsIs() 보호된 메소드

Just sets the value to the segment as is.
protected encodeUrlParameterBlockUseAsIs ( string $getVarName, string $getVarValue, array $configuration, array &$segments, string &$previousValue ) : boolean
$getVarName string
$getVarValue string
$configuration array
$segments array
$previousValue string
리턴 boolean

encodeUrlParameterBlockUsingLookupTable() 보호된 메소드

Uses lookUpMap to set the segment.
protected encodeUrlParameterBlockUsingLookupTable ( string $getVarName, string $getVarValue, array $configuration, array &$segments, string &$previousValue ) : boolean
$getVarName string
$getVarValue string
$configuration array
$segments array
$previousValue string
리턴 boolean

encodeUrlParameterBlockUsingNoMatch() 보호된 메소드

Uses 'noMatch' options to set the segment.
protected encodeUrlParameterBlockUsingNoMatch ( string $getVarName, string $getVarValue, array $configuration, array &$segments, string &$previousValue ) : boolean
$getVarName string
$getVarValue string
$configuration array
$segments array
$previousValue string
리턴 boolean

encodeUrlParameterBlockUsingUserFunc() 보호된 메소드

Calls the userFunc for the value to get the segment.
protected encodeUrlParameterBlockUsingUserFunc ( string $getVarName, string $getVarValue, array $configuration, array &$segments, string &$previousValue ) : boolean
$getVarName string
$getVarValue string
$configuration array
$segments array
$previousValue string
리턴 boolean

encodeUrlParameterBlockUsingValueDefault() 보호된 메소드

Just sets the default value to the segment.
protected encodeUrlParameterBlockUsingValueDefault ( string $getVarName, string $getVarValue, array $configuration, array &$segments, string &$previousValue ) : boolean
$getVarName string
$getVarValue string
$configuration array
$segments array
$previousValue string
리턴 boolean

encodeUrlParameterBlockUsingValueMap() 보호된 메소드

Uses the value map to determine the segment value.
protected encodeUrlParameterBlockUsingValueMap ( string $getVarName, string $getVarValue, array $configuration, array &$segments, string &$previousValue ) : boolean
$getVarName string
$getVarValue string
$configuration array
$segments array
$previousValue string
리턴 boolean

executeEncoder() 보호된 메소드

Encodes the URL.
protected executeEncoder ( ) : void
리턴 void

fetchFromUrlCache() 보호된 메소드

Attempts to fetch the speaking URL from the url cache.
protected fetchFromUrlCache ( ) : boolean
리턴 boolean

fixEmptySegments() 보호된 메소드

Changes empty segments to the value of $this->emptySegmentValue.
protected fixEmptySegments ( array &$segments )
$segments array

fixPageId() 보호된 메소드

Fixes page id if it is not a direct numeric page id.
protected fixPageId ( )

getConfiguration() 공개 메소드

Returns the configuration reader. This can be used in hooks.
public getConfiguration ( ) : ConfigurationReader
리턴 DmitryDulepov\Realurl\Configuration\ConfigurationReader

getFromAliasCache() 보호된 메소드

Obtains the value from the alias cache.
protected getFromAliasCache ( array $configuration, string $getVarValue, integer $languageUid, string $onlyThisAlias = '' ) : string | null
$configuration array
$getVarValue string
$languageUid integer
$onlyThisAlias string
리턴 string | null

getOriginalUrlParameters() 공개 메소드

Returns a coipy of original url parameters. This can be used in hooks.
public getOriginalUrlParameters ( ) : array
리턴 array

getUtility() 공개 메소드

Returns $this->utility. This can be used in hooks.
public getUtility ( ) : Utility
리턴 DmitryDulepov\Realurl\Utility

handleFileName() 보호된 메소드

Appends file name and suffix if necessary.
protected handleFileName ( ) : void
리턴 void

handleFileNameSetDefaultSuffix() 보호된 메소드

Sets the default suffix to the URL if configured so.
protected handleFileNameSetDefaultSuffix ( ) : void
리턴 void

handleFileNameUsingGetVars() 보호된 메소드

Checks if the file name like 'rss.xml' should be produced according to _GET vars.
protected handleFileNameUsingGetVars ( ) : boolean
리턴 boolean

hasUrlParameters() 보호된 메소드

Checks if any GETvar from the parameter block is present in $this->urlParameters.
protected hasUrlParameters ( array $configurationArray ) : boolean
$configurationArray array
리턴 boolean

initializeConfiguration() 보호된 메소드

Initializes configuration reader.
protected initializeConfiguration ( )

initializeUrlPrepend() 보호된 메소드

Checks if we should prpend URL according to _DOMAINS configuration.
protected initializeUrlPrepend ( ) : void
리턴 void

isProperTsfe() 보호된 메소드

Checks if TSFE is initialized correctly.
protected isProperTsfe ( ) : boolean
리턴 boolean

isRealURLEnabled() 보호된 메소드

Checks if RealURL is enabled.
protected isRealURLEnabled ( ) : boolean
리턴 boolean

isSimulateStaticEnabled() 보호된 메소드

Checks if simulatestatic is enabled.
protected isSimulateStaticEnabled ( ) : boolean
리턴 boolean

isTypo3Url() 보호된 메소드

Checks if a TYPO3 URL is going to be encoded.
protected isTypo3Url ( ) : boolean
리턴 boolean

parseUrlParameters() 보호된 메소드

Parses query string to a set of key/value inside $this->urlParameters.
protected parseUrlParameters ( ) : void
리턴 void

postProcessEncodedUrl() 공개 메소드

Post-processes the URL. If necessary prepends another domain to the URL.
public postProcessEncodedUrl ( array &$parameters, TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $pObj ) : void
$parameters array
$pObj TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
리턴 void

prepareUrlPrepend() 보호된 메소드

Prepares the URL to use with _DOMAINS configuration.
protected prepareUrlPrepend ( ) : void
리턴 void

reapplyAbsRefPrefix() 보호된 메소드

Reapplies absRefPrefix if necessary.
protected reapplyAbsRefPrefix ( ) : void
리턴 void

removeIgnoredUrlParameters() 보호된 메소드

Removes ignored parameters from various members.

removeIgnoredUrlParametersFromArray() 보호된 메소드

Removes ignored URL parameters from the parameter list.
protected removeIgnoredUrlParametersFromArray ( array $urlParameters ) : array
$urlParameters array
리턴 array

setLanguage() 보호된 메소드

Sets language for the encoder either from the URl or from the TSFE.
protected setLanguage ( ) : void
리턴 void

storeAliasToUrlCacheMapping() 보호된 메소드

Stores mapping between used aliases and url cache id. This information is used in the DataHandle hook to clear URl cache when record are renamed (= aliases change).
protected storeAliasToUrlCacheMapping ( string $urlCacheId ) : void
$urlCacheId string
리턴 void

storeInAliasCache() 보호된 메소드

Adds the value to the alias cache.
protected storeInAliasCache ( array $configuration, string $newAliasValue, string $idValue, integer $languageUid ) : string
$configuration array
$newAliasValue string
$idValue string
$languageUid integer
리턴 string

storeInUrlCache() 보호된 메소드

Stores data in the URL cache.
protected storeInUrlCache ( ) : void
리턴 void

trimMultipleSlashes() 보호된 메소드

Removes multiple slashes at the end of the encoded URL.
protected trimMultipleSlashes ( )

프로퍼티 상세

$encodedUrl 보호되어 있는 프로퍼티

protected string $encodedUrl
리턴 string

$encoderParameters 보호되어 있는 프로퍼티

protected array $encoderParameters
리턴 array

$originalUrl 보호되어 있는 프로퍼티

This is the URL with sorted GET parameters. It is used for cache manipulation.
protected string $originalUrl
리턴 string

$originalUrlParameters 보호되어 있는 프로퍼티

protected array $originalUrlParameters
리턴 array

$pageRepository 보호되어 있는 프로퍼티

protected PageRepository,TYPO3\CMS\Frontend\Page $pageRepository
리턴 TYPO3\CMS\Frontend\Page\PageRepository

$sysLanguageUid 보호되어 있는 프로퍼티

protected int $sysLanguageUid
리턴 integer

$urlParameters 보호되어 있는 프로퍼티

protected array $urlParameters
리턴 array

$urlPrepend 보호되어 있는 프로퍼티

protected string $urlPrepend
리턴 string

$urlPrependRegister 보호되어 있는 정적으로 프로퍼티

protected static array $urlPrependRegister
리턴 array

$urlToEncode 보호되어 있는 프로퍼티

protected string $urlToEncode
리턴 string

$usedAliases 보호되어 있는 프로퍼티

protected array $usedAliases
리턴 array