Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cUriBuilderMR
  • ModRewrite
  • ModRewrite_ContentController
  • ModRewrite_ContentExpertController
  • ModRewrite_ContentTestController
  • ModRewrite_ControllerAbstract
  • ModRewriteBase
  • ModRewriteController
  • ModRewriteDebugger
  • ModRewriteTest
  • ModRewriteUrlStack
  • ModRewriteUrlUtil

Functions

  • mr_arrayValue
  • mr_buildGeneratedCode
  • mr_buildNewUrl
  • mr_conCopyArtLang
  • mr_conMoveArticles
  • mr_conSaveArticle
  • mr_conSyncArticle
  • mr_debugOutput
  • mr_getConfiguration
  • mr_getRequest
  • mr_header
  • mr_i18n
  • mr_loadConfiguration
  • mr_queryAndNextRecord
  • mr_removeMultipleChars
  • mr_requestCleanup
  • mr_runFrontendController
  • mr_setClientLanguageId
  • mr_setConfiguration
  • mr_strCopyCategory
  • mr_strMovedownCategory
  • mr_strMoveSubtree
  • mr_strMoveUpCategory
  • mr_strNewCategory
  • mr_strNewTree
  • mr_strRenameCategory
  • mr_strSyncCategory
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

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'
Package: Plugin\ModRewrite
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
Methods summary
private
# __construct( )

Constructor, sets some properties.

Constructor, sets some properties.

public static ModRewriteUrlStack
# getInstance( )

Returns a instance of ModRewriteUrlStack (singleton implementation)

Returns a instance of ModRewriteUrlStack (singleton implementation)

Returns

ModRewriteUrlStack
public
# add( string $url )

Adds an url to the stack

Adds an url to the stack

Parameters

$url
string
Url, like front_content.php?idcat=123...
public array
# getPrettyUrlParts( string $url )

Returns the pretty urlparts (only category path an article name) of the desired url.

Returns the pretty urlparts (only category path an article name) of the desired url.

Parameters

$url
string
Url, like front_content.php?idcat=123...

Returns

array
Assoziative array like <code> $arr['urlpath'] $arr['urlname'] </code>
private array
# _extractUrl( string $url )

Extracts passed url using parse_urla and adds also the 'params' array to it

Extracts passed url using parse_urla and adds also the 'params' array to it

Parameters

$url
string
Url, like front_content.php?idcat=123...

Returns

array
Components containing result of parse_url with additional 'params' array
private string
# _makeStackId( array $aParams )

Extracts article or category related parameter from passed params array and generates an identifier.

Extracts article or category related parameter from passed params array and generates an identifier.

Parameters

$aParams
array
$aParams Parameter array

Returns

string
Composed stack id
private
# _chunkSetPrettyUrlParts( )

Main function to get the urlparts of urls.

Main function to get the urlparts of urls.

Composes the query by looping thru stored but non processed urls, executes the query and adds the (urlpath and urlname) result to the stack.

Properties summary
private static ModRewriteUrlStack $_instance
#

Self instance

Self instance

private cDb $_oDb
#

Database object

Database object

private array $_aUrls array()
#

Array for urls

Array for urls

private array $_aStack array()
#

Url stack array

Url stack array

private array $_aConParams array( 'idcat' => 1, 'idart' => 1, 'lang' => 1, 'idcatlang' => 1, 'idcatart' => 1, 'idartlang' => 1 )
#

CONTENIDO related parameter array

CONTENIDO related parameter array

private array $_aTab
#

Database tables array

Database tables array

private integer $_idLang
#

Language id

Language id

CMS CONTENIDO 4.9.1 API documentation generated by ApiGen 2.8.0