UNA
Loading...
Searching...
No Matches
BxDolPermalinks Class Reference
Inheritance diagram for BxDolPermalinks:
BxDolDb iBxDolSingleton BxDolFactory iBxDolSingleton

Public Member Functions

 cacheInvalidate ()
 
 __clone ()
 
 getPermalinksData ()
 
 getPageNameFromLink ($sLink, $iLength=false)
 
 permalink ($sLink, $aParams=array())
 
 unpermalink ($sLink, $isStripBaseUrl=true)
 
 _isEnabled ($sLink)
 
 redirectIfNecessary ($aSkip=array())
 
- Public Member Functions inherited from BxDolDb
 setReadOnlyMode ($b)
 
 connect ()
 
 disconnect ()
 
 ping ()
 
 pdoExec ($sQuery)
 
 pdoQuery ($sQuery)
 
 pdoExceptionHandler ($oException)
 
 getOption ($sName)
 
 getOne ($oStatement, $aBindings=array(), $iIndex=0)
 
 getRow ($oStatement, $aBindings=array(), $iFetchType=PDO::FETCH_ASSOC)
 
 getColumn ($oStatement, $aBindings=array(), $iFetchColumnNumber=0)
 
 getFirstRow ($oStatement, $aBindings=array(), $iFetchType=PDO::FETCH_ASSOC)
 
 getNextRow ($iFetchType=PDO::FETCH_ASSOC)
 
 getAll ($oStatement, $aBindings=array(), $iFetchType=PDO::FETCH_ASSOC)
 
 fillArray ($oStatement, $aBindings=array(), $iFetchType=PDO::FETCH_ASSOC)
 
 getAllWithKey ($oStatement, $sFieldKey, $aBindings=array(), $iFetchType=PDO::FETCH_ASSOC)
 
 getPairs ($oStatement, $sFieldKey, $sFieldValue, $aBindings=array(), $iFetchType=PDO::FETCH_ASSOC)
 
 getNumRows ($oStatement=null)
 
 getAffectedRows ($oStatement=null)
 
 lastId ()
 
 query ($oStatement, $aBindings=array(), $bVerbose=null)
 
 res ($oStatement, $aBindings=array(), $bVerbose=null)
 
 getServerInfo ()
 
 getVersion ()
 
 listTables ()
 
 getFields ($sTable)
 
 fetchField ($oStatement, $iField, $aBindings=array())
 
 isTableExists ($sTable)
 
 isFieldExists ($sTable, $sFieldName)
 
 isIndexExists ($sTable, $sIndexName)
 
 error ($aError)
 
 cacheParams ($bForceCacheInvalidate=false, $bForceCacheInvalidateMixed=false)
 
 cacheParamsClear ($sCacheName='')
 
 isParam ($sKey, $bFromCache=true)
 
 addParam ($sName, $sValue, $iKateg, $sDesc, $sType)
 
 getParam ($sKey, $bFromCache=true)
 
 setParam ($sKey, $mixedValue, $iMixId=0)
 
 getParamsMix ($iId)
 
 getParamsMixActive ($sType)
 
 getParamsMixes ($sType, $mixedPublished=false)
 
 setTimezone ($sTimezone)
 
 getEncoding ()
 
 setErrorChecking ($b)
 
 getDbCacheObject ()
 
 genDbCacheKey ($sName)
 
 getCache ($sName, $sFunc)
 
 setCache ($sName, $mData)
 
 fromCache ($sName, $sFunc)
 
 cleanCache ($sName)
 
fromMemory ($sName, $sFunc)
 
 cleanMemory ($sName)
 
 cleanMemoryAll ()
 
 escape ($s)
 
 implode_escape ($mixed)
 
 unescape ($mixed)
 
 prepare ($sQuery)
 
 prepareAsString ($sQuery)
 
 arrayToSQL ($a, $sDiv=',', $sOperator='=', $bWildcardSpaceChars=false)
 
 executeSQL ($sPath, $aReplace=array(), $isBreakOnError=true)
 

Static Public Member Functions

static getInstance ()
 
- Static Public Member Functions inherited from BxDolDb
static getInstanceWithConf ($aDbConf, &$sError)
 
static getLink ()
 

Protected Member Functions

 _fixUrlAmpersand ($sLink)
 
 _fixUrl ($sLink)
 
- Protected Member Functions inherited from BxDolDb
 __construct ($aDbConf=false)
 
 balancer ()
 
 isParamInCache ($sKey)
 
 log ($s)
 
 executeStatement ($oStatement, $aBindings=array(), $bVerbose=null, &$iErrorCode=null)
 
 executeStatementException ($oStatement, $aBindings=array(), $bVerbose=null)
 
 executeStatementSilent ($oStatement, $aBindings=array(), $bVerbose=null)
 
 errorOutput ($aError)
 

Protected Attributes

 $sCacheFile
 
 $aLinksStandard
 
 $aLinksPermalink
 
 $aPrefixesStandard
 
 $aPrefixesPermalink
 
- Protected Attributes inherited from BxDolDb
 $_bPdoPersistent
 
 $_iPdoFetchType
 
 $_iPdoErrorMode
 
 $_bErrorChecking
 
 $_aError
 
 $_sHost
 
 $_sPort
 
 $_sSocket
 
 $_sDbname
 
 $_sUser
 
 $_sPassword
 
 $_sCharset
 
 $_sStorageEngine
 
 $_oStatement = null
 
 $_oDbCacheObject = null
 

Additional Inherited Members

- Static Protected Attributes inherited from BxDolDb
static $_rLink
 
static $_aDbCacheData
 
static $_aParams
 
static $_sParamsCacheName = 'sys_options'
 
static $_sParamsCacheNameMixed = 'sys_options_mixed_'
 
static $_sParamsCacheNameMix = 'sys_options_mix_'
 
static $_sErrorKey = 'bx_db_error'
 
static $_aErrors
 
static $_bReadOnlyMode = true
 
static $_bMultuServersMode = false
 

Detailed Description

Permalinks for any content.

An object of the class allows to check whether permalink is enabled and get it for specified standard URI.

All permalinks must match the whole URL, to be automatially determined. There are only 2 permlinks which are replaced by prefix:

  • modules/?r= - for module URLs
  • page.php?i= - for pages URLs

Example of usage

  1. Register permalink in database by adding necessary info in the sys_permalinks table.
  2. Create an object and process the URI
    $oPermalinks = new BxDolPermalinks();
    $oPermalinks->permalink('modules/?r=news/home');

Memberships/ACL:

Doesn't depend on user's membership.

Alerts(hooks)

The following alert can be used when permalink call is performed:

  • $sUnit - system
  • $sAction - permalink | unpermalink
  • $iObjectId - 0 (not used)
  • $iSenderId - 0 (not used)
  • $aExtra['link'] - the link to check permalink for
  • $aExtra['return_data'] - it is possible to override default behavior, by setting 'return_data' to non NULL value.

Constructor & Destructor Documentation

◆ __construct()

BxDolPermalinks::__construct ( )
protected

Reimplemented from BxDolFactory.

Member Function Documentation

◆ __clone()

BxDolPermalinks::__clone ( )

Prevent cloning the instance

Reimplemented from BxDolDb.

◆ getInstance()

static BxDolPermalinks::getInstance ( )
static

Get singleton instance of the class

Reimplemented from BxDolDb.

◆ getPageNameFromLink()

BxDolPermalinks::getPageNameFromLink ( $sLink,
$iLength = false )

Get page name (changeable page of URL) from the URL.

Parameters
$sLink- relative UNpermalinked, it is better to use unpermalink method to make sure that correct url is passed here
$iLength- position of the page name, or false to detect automatically
Returns
page name (changeable part of URL) or empty string if page name is not detectable.

◆ permalink()

BxDolPermalinks::permalink ( $sLink,
$aParams = array() )

Make permalink from link.

Parameters
$sLink- relative URL.
$aParams- params to add to the url.
Returns
- relative permalinked URL if it was detected and permalinks are ON or unchanged URL otherwise.

Hooks:

'system', 'permalink' - hook to override permalink during link to permalink conversion

  • $unit_name - equals system
  • $action - equals permalink
  • $object_id - not used
  • $sender_id - not used
  • $extra_params - array of additional params with the following array keys:

◆ redirectIfNecessary()

BxDolPermalinks::redirectIfNecessary ( $aSkip = array())

redirect to the correct url after switching skin or language only correct modules urls are supported

◆ unpermalink()

BxDolPermalinks::unpermalink ( $sLink,
$isStripBaseUrl = true )

Remove permalink from link.

Parameters
$sLink- relative or absoulte URL.
$isStripBaseUrl- strip site prefix (absolute URL) automatically (enabled by default)
Returns
- relative UNpermalinked URL if it was detected or relative URL if URL withing the site or unchanged URL otherwise.

Hooks:

'system', 'unpermalink' - hook to override link during permalink to link conversion


The documentation for this class was generated from the following file: