Class ModRewriteUrlStack
Mod rewrite url stack class. Provides features to collect urls and to get the pretty path and names of categories/articles at one go.
Main goal of this class is to collect urls and to get the urlpath and urlname of the related categories/articles at one go. This will reduce the queries against the database. Therefore the full advantage will be taken by rewriting the urls at codeoutput in front_content.php, where you will be able to collect all urls at once...
Usage:
// get the instance $oMRUrlStack = ModRewriteUrlStack::getInstance(); // add several urls to fill the stack $oMRUrlStack->add('front_content.php?idcat=123'); $oMRUrlStack->add('front_content.php?idart=321'); $oMRUrlStack->add('front_content.php?idcatart=213'); $oMRUrlStack->add('front_content.php?idcatlang=213'); $oMRUrlStack->add('front_content.php?idartlang=312'); // now the first call will get the pretty path and names from database at one go $aPrettyParts = $oMRUrlStack->getPrettyUrlParts('front_content.php?idcat=123'); echo $aPrettyParts['urlpath']; // something like 'Main-category-name/Category-name/Another-category-name/' echo $aPrettyParts['urlname']; // something like 'Name-of-an-article'
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Murat Purc <murat@purc.de>
Located at plugins/mod_rewrite/classes/class.modrewriteurlstack.php
private
|
|
public static
|
|
public
|
|
public
array
|
#
getPrettyUrlParts( string $url )
Returns the pretty urlparts (only category path an article name) of the desired url. |
private
array
|
#
_extractUrl( string $url )
Extracts passed url using parse_urla and adds also the 'params' array to it |
private
string
|
#
_makeStackId( array $aParams )
Extracts article or category related parameter from passed params array and generates an identifier. |
private
|
private static
|
$_instance |
|
#
Self instance |
private
|
$_oDb |
|
#
Database object |
private
array
|
$_aUrls | array() |
#
Array for urls |
private
array
|
$_aStack | array() |
#
Url stack array |
private
array
|
$_aConParams | array(
'idcat' => 1, 'idart' => 1, 'lang' => 1, 'idcatlang' => 1, 'idcatart' => 1, 'idartlang' => 1
) |
#
CONTENIDO related parameter array |
private
array
|
$_aTab |
|
#
Database tables array |
private
integer
|
$_idLang |
|
#
Language id |