Mod Rewrite controller class.

Extracts url parts and sets some necessary globals like: - $idart - $idcat - $client - $changeclient - $lang - $changelang

author Murat Purc
package plugin
subpackage Mod Rewrite

 Methods

Constructor, sets several properties.

__construct(string $incommingUrl) 

Parameters

$incommingUrl

string

Incomming URL

Getter for occured error state

errorOccured() : bool

Returns

boolFlag for occured error

Main function to call for mod rewrite related preprocessing jobs.

execute() 

Executes some private functions to extract request URI and to set needed membervariables (client, language, article id, category id, etc.)

Getter for overwritten change client id (see $GLOBALS['changeclient'])

getChangeClient() : int

Returns

intChange client id

Getter for change language id (see $GLOBALS['changelang'])

getChangeLang() : int

Returns

intChange language id

Getter for overwritten client id (see $GLOBALS['client'])

getClient() : int

Returns

intClient id

Returns configuration of mod rewrite, content of gobal $cfg['mod_rewrite']

getConfig(string $key, mixed $default) : mixed
InheritedStatic
inherited_from \ModRewriteBase::getConfig()

Parameters

$key

string

Name of configuration key

$default

mixed

Default value to return as a fallback

Returns

mixedDesired value mr configuration, either the full configuration or one of the desired subpart

Getter for occured error state

getError() : int

Returns

intNumeric error code

Getter for article id (see $GLOBALS['idart'])

getIdArt() : int

Returns

intArticle id

Getter for category id (see $GLOBALS['idcat'])

getIdCat() : int

Returns

intCategory id

Getter for language id (see $GLOBALS['lang'])

getLang() : int

Returns

intLanguage id

Getter for path (see $GLOBALS['path'])

getPath() : string

Returns

stringPath, used by path resolver

Getter for resolved url

getResolvedUrl() : string

Returns

stringResolved url

Returns a flag about found routing definition

getRoutingFoundState() 

return bool Flag about found routing

Returns enabled state of mod rewrite plugin

isEnabled() : bool
InheritedStatic
inherited_from \ModRewriteBase::isEnabled()

Returns

bool

Sets the configuration of mod rewrite, content of gobal $cfg['mod_rewrite']

setConfig(string $key, mixed $value) 
InheritedStatic
inherited_from \ModRewriteBase::setConfig()

Parameters

$key

string

Name of configuration key

$value

mixed

The value to set

Sets the enabled state of mod rewrite plugin

setEnabled(bool $bEnabled) 
InheritedStatic
inherited_from \ModRewriteBase::setEnabled()

Parameters

$bEnabled

bool

Extracts request URI and sets member variables $this->_sArtName and $this->_aParts

_extractRequestUri(bool $secondCall) 

Parameters

$secondCall

bool

Flag about second call of this function, is needed to re extract url if a routing definition was found

Returns state of parts property.

_hasPartArrayItems() : bool

Returns

boolTrue if $this->_aParts propery contains items

Tries to initialize the client id.

_initializeClientId() 

This is required to load the proper plugin configuration for current client.

Tries to initialize the language id.

_initializeLanguageId() 

Checks if current request was a root request.

_isRootRequest() : bool

Returns

bool

Parses the url using defined separators

_parseUrl(string $url) : string

Parameters

$url

string

Incoming url

Returns

stringParsed url

Does post validation of the extracted data.

_postValidation() 

One main goal of this function is to prevent duplicated content, which could happen, if the configuration 'startfromroot' is activated.

Detects client id from given url

_setClientId() 

Sets error code and error flag (everything greater than 0 is an error)

_setError(int $errCode) 

Parameters

$errCode

int

Sets article id

_setIdart() 

Sets language id

_setLanguageId() 

Sets path resolver and category id

_setPathresolverSetting() 

 Properties

 

$_aParts : array
 

$_bError : bool
 

$_bRoutingFound : bool
 

$_iClientMR : int
 

$_iError : int
 

$_iLangMR : int
 

$_sArtName : string
 

$_sIncommingUrl : string
 

$_sPath : string
 

$_sResolvedUrl : string

 Constants

 

ERROR_ARTICLE

ERROR_ARTICLE 
 

ERROR_CATEGORY

ERROR_CATEGORY 
 

ERROR_CLIENT

ERROR_CLIENT 
 

ERROR_LANGUAGE

ERROR_LANGUAGE 
 

ERROR_POST_VALIDATION

ERROR_POST_VALIDATION 
 

FRONT_CONTENT

FRONT_CONTENT