Mod Rewrite controller class. Extracts url parts and sets some necessary globals like: - $idart - $idcat - $client - $changeclient - $lang - $changelang

Provides some common features such as common debugging, globals/configuration access for childs.

author Murat Purc
package Contenido Backend plugins
subpackage ModRewrite

 Methods

Constructor, sets several properties.

__construct(string $incommingUrl) 

Parameters

$incommingUrl

string

Incomming URL

Returns state of parts property.

_hasPartArrayItems() : bool

access private

Returns

boolTrue if $this->_aParts propery is an array and contains items

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['change_lang'])

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, $default) : mixed
Inherited

inherited_from \ModRewriteBase::getConfig()

Parameters

$key

string

Name of configuration key

$default

Returns

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

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
Inherited

inherited_from \ModRewriteBase::isEnabled()

Returns

bool

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

setConfig(string $key, mixed $value) 
Inherited

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($bEnabled) 
Inherited

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

Parameters

$bEnabled

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

Tries to initialize the client id

_initializeClientId() 

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.

Sets client id

_setClientId() 

Sets article id

_setIdart() 

Sets language id

_setLanguageId() 

Sets path resolver and category id

_setPathresolverSetting() 

 Properties

 

Extracted request uri path parts by path separator '/'

$_aParts : array

 

Flag about occured errors

$_bError : bool

 

Flag about found routing definition

$_bRoutingFound : bool

 

Client id used by this class

$_iClientMR : int

 

Extracted article name from request uri

$_sArtName : string

 

Incomming URL

$_sIncommingUrl : string

 

Remaining path for path resolver (see $GLOBALS['path'])

$_sPath : string

 

Resolved URL

$_sResolvedUrl : string