OXID eShop CE  4.10.0
 All Classes Namespaces Files Functions Variables Pages
oxSeoEncoder Class Reference
+ Inheritance diagram for oxSeoEncoder:
+ Collaboration diagram for oxSeoEncoder:

Public Member Functions

 addLanguageParam ($sSeoUrl, $iLang)
 __construct ()
 getDynamicObjectId ($iShopId, $sStdUrl)
 encodeString ($sString, $blReplaceChars=true, $iLang=false)
 setSeparator ($sSeparator=null)
 setPrefix ($sPrefix)
 setIdLength ($iIdlength=null)
 setReservedWords ($aReservedWords)
 markAsExpired ($sId, $iShopId=null, $iExpStat=1, $iLang=null, $sParams=null)
 encodeStaticUrls ($aStaticUrl, $iShopId, $iLang)
 copyStaticUrls ($iShopId)
 getStaticUrl ($sStdUrl, $iLang=null, $iShopId=null)
 addSeoEntry ($sObjectId, $iShopId, $iLang, $sStdUrl, $sSeoUrl, $sType, $blFixed=1, $sKeywords= '', $sDescription= '', $sParams= '', $blExclude=false, $sAltObjectId=null)
 deleteSeoEntry ($sObjectId, $iShopId, $iLang, $sType)
 getMetaData ($sObjectId, $sMetaType, $iShopId=null, $iLang=null)
 getDynamicUrl ($sStdUrl, $sSeoUrl, $iLang)
 fetchSeoUrl ($sStdUrl, $iLanguage=null)
- Public Member Functions inherited from oxSuperCfg
 __call ($sMethod, $aArgs)
 getConfig ()
 setConfig ($oConfig)
 getSession ()
 setSession ($oSession)
 getUser ()
 setUser ($oUser)
 isAdmin ()
 setAdminMode ($blAdmin)

Protected Member Functions

 _processSeoUrl ($sSeoUrl, $sObjectId=null, $iLang=null, $blExclude=false)
 _copyToHistory ($sId, $iShopId, $iLang, $sType=null, $sNewId=null)
 _getDynamicUri ($sStdUrl, $sSeoUrl, $iLang)
 _getFullUrl ($sSeoUrl, $iLang=null, $blSsl=false)
 _getSeoIdent ($sSeoUrl)
 _getStaticUri ($sStdUrl, $iShopId, $iLang)
 _getUrlExtension ()
 _getUniqueSeoUrl ($sSeoUrl, $sObjectId=null, $iObjectLang=null)
 _isFixed ($sType, $sId, $iLang, $iShopId=null, $sParams=null, $blStrictParamsCheck=true)
 _getCacheKey ($sType, $iLang=null, $iShopId=null, $sParams=null)
 _loadFromCache ($sCacheIdent, $sType, $iLang=null, $iShopId=null, $sParams=null)
 _saveInCache ($sCacheIdent, $sCache, $sType, $iLang=null, $iShopId=null, $sParams=null)
 _loadFromDb ($sType, $sId, $iLang, $iShopId=null, $sParams=null, $blStrictParamsCheck=true)
 _getReservedEntryKeys ()
 _prepareUri ($sUri, $iLang=false)
 _prepareTitle ($sTitle, $blSkipTruncate=false, $iLang=false)
 _saveToDb ($sType, $sObjectId, $sStdUrl, $sSeoUrl, $iLang, $iShopId=null, $blFixed=null, $sParams=null)
 _trimUrl ($sUrl, $iLang=null)
 _getMaxUrlLength ()
 _getPageUri ($oObject, $sType, $sStdUrl, $sSeoUrl, $sParams, $iLang=null, $blFixed=false)
 _getStaticObjectId ($iShopId, $sStdUrl)
 _getAltUri ($sObjectId, $iLang)

Protected Attributes

 $_iIdLength = 255
 $_sAddParams = null
 $_iMaxUrlLength = null

Static Protected Attributes

static $_aReservedWords = array('admin')
static $_aReservedEntryKeys = null
static $_sSeparator = null
static $_sPrefix = null
static $_aFixedCache = array()
static $_sCacheKey = null
static $_aCache = array()
- Static Protected Attributes inherited from oxSuperCfg
static $_oConfig = null
static $_oSession = null
static $_oRights = null
static $_oActUser = null
static $_blIsAdmin = null

Detailed Description

Seo encoder base

Definition at line 7 of file oxseoencoder.php.

Constructor & Destructor Documentation

oxSeoEncoder::__construct ( )

SEO encoder constructor

Reimplemented from oxSuperCfg.

Definition at line 126 of file oxseoencoder.php.

Member Function Documentation

oxSeoEncoder::_copyToHistory (   $sId,
  $iShopId,
  $iLang,
  $sType = null,
  $sNewId = null 
)
protected

Moves current seo record to seo history table

Parameters
string$sIdobject id
int$iShopIdactive shop id
int$iLangobject language
string$sTypeobject type (if you pass real object - type is not necessary)
string$sNewIdnew object id, mostly used for static url updates (optional)

Definition at line 147 of file oxseoencoder.php.

oxSeoEncoder::_getAltUri (   $sObjectId,
  $iLang 
)
protected

Returns alternative uri used while updating seo

Parameters
string$sObjectIdobject id
int$iLanglanguage id

Reimplemented in oxSeoEncoderArticle, oxSeoEncoderCategory, oxSeoEncoderManufacturer, oxSeoEncoderVendor, and oxSeoEncoderContent.

Definition at line 1138 of file oxseoencoder.php.

oxSeoEncoder::_getCacheKey (   $sType,
  $iLang = null,
  $iShopId = null,
  $sParams = null 
)
protected

Returns cache key (in non admin mode)

Parameters
string$sTypeobject type
int$iLangactive language id
mixed$iShopIdactive shop id
string$sParamsadditional seo params. optional (mostly used for db indexing)
Returns
string

Definition at line 382 of file oxseoencoder.php.

oxSeoEncoder::_getDynamicUri (   $sStdUrl,
  $sSeoUrl,
  $iLang 
)
protected

Returns dynamic object SEO URI

Parameters
string$sStdUrlstandard url
string$sSeoUrlseo uri
int$iLangactive language
Returns
string

Definition at line 184 of file oxseoencoder.php.

oxSeoEncoder::_getFullUrl (   $sSeoUrl,
  $iLang = null,
  $blSsl = false 
)
protected

Returns SEO url with shop's path + additional params ( oxseoencoder:: _getAddParams)

Parameters
string$sSeoUrlseo URL
int$iLangactive language
bool$blSslforces to build ssl url
Returns
string

Definition at line 222 of file oxseoencoder.php.

oxSeoEncoder::_getMaxUrlLength ( )
protected

Returns maximum seo/dynamic url length

Returns
int

Definition at line 794 of file oxseoencoder.php.

oxSeoEncoder::_getPageUri (   $oObject,
  $sType,
  $sStdUrl,
  $sSeoUrl,
  $sParams,
  $iLang = null,
  $blFixed = false 
)
protected

Loads if exists or prepares and saves new seo url for passed object

Parameters
oxbase$oObjectobject to prepare seo data
string$sTypetype of object (oxvendor/oxcategory)
string$sStdUrlstanradr url
string$sSeoUrlseo uri
string$sParamsadditional params, liek page number etc. mostly used by mysql for indexes
int$iLanglanguage
bool$blFixedfixed url marker (default is false)
Returns
string

Definition at line 923 of file oxseoencoder.php.

oxSeoEncoder::_getReservedEntryKeys ( )
protected

cached getter: check root directory php file names for them not to be in 1st part of seo url because then apache will execute that php file instead of url parser

Returns
array

Definition at line 545 of file oxseoencoder.php.

oxSeoEncoder::_getSeoIdent (   $sSeoUrl)
protected

_getSeoIdent returns seo ident for db search

Parameters
string$sSeoUrlseo url

protected

Returns
string

Definition at line 242 of file oxseoencoder.php.

oxSeoEncoder::_getStaticObjectId (   $iShopId,
  $sStdUrl 
)
protected

Generates static url object id

Parameters
int$iShopIdshop id
string$sStdUrlstandard (dynamic) url
Returns
string

Definition at line 952 of file oxseoencoder.php.

oxSeoEncoder::_getStaticUri (   $sStdUrl,
  $iShopId,
  $iLang 
)
protected

Returns SEO static uri

Parameters
string$sStdUrlstandard page url
int$iShopIdactive shop id
int$iLangactive language
Returns
string

Definition at line 256 of file oxseoencoder.php.

oxSeoEncoder::_getUniqueSeoUrl (   $sSeoUrl,
  $sObjectId = null,
  $iObjectLang = null 
)
protected

_getUniqueSeoUrl returns possibly modified url for not to be same as already existing in db

Parameters
string$sSeoUrlseo url
string$sObjectIdcurrent object id, used to skip self in query
int$iObjectLangobject language id

protected

Returns
string

Definition at line 285 of file oxseoencoder.php.

oxSeoEncoder::_getUrlExtension ( )
protected

Returns target "extension"

Returns
null

Reimplemented in oxSeoEncoderCategory, oxSeoEncoderArticle, oxSeoEncoderManufacturer, oxSeoEncoderVendor, and oxSeoEncoderContent.

Definition at line 268 of file oxseoencoder.php.

oxSeoEncoder::_isFixed (   $sType,
  $sId,
  $iLang,
  $iShopId = null,
  $sParams = null,
  $blStrictParamsCheck = true 
)
protected

check if seo url exist and is fixed

Parameters
string$sTypeobject type
string$sIdobject identifier
int$iLangactive language id
mixed$iShopIdactive shop id
string$sParamsadditional seo params. optional (mostly used for db indexing)
bool$blStrictParamsCheckstrict parameters check

protected

Returns
bool

Definition at line 341 of file oxseoencoder.php.

oxSeoEncoder::_loadFromCache (   $sCacheIdent,
  $sType,
  $iLang = null,
  $iShopId = null,
  $sParams = null 
)
protected

Loads seo data from cache for active view (in non admin mode)

Parameters
string$sCacheIdentcache identifier
string$sTypeobject type
int$iLangactive language id
mixed$iShopIdactive shop id
string$sParamsadditional seo params. optional (mostly used for db indexing)
Returns
string

Definition at line 411 of file oxseoencoder.php.

oxSeoEncoder::_loadFromDb (   $sType,
  $sId,
  $iLang,
  $iShopId = null,
  $sParams = null,
  $blStrictParamsCheck = true 
)
protected

_loadFromDb loads data from oxseo table if exists returns oxseo url

Parameters
string$sTypeobject type
string$sIdobject identifier
int$iLangactive language id
mixed$iShopIdactive shop id
string$sParamsadditional seo params. optional (mostly used for db indexing)
bool$blStrictParamsCheckstrict parameters check

protected

Returns
string || false

Definition at line 481 of file oxseoencoder.php.

oxSeoEncoder::_prepareTitle (   $sTitle,
  $blSkipTruncate = false,
  $iLang = false 
)
protected

Prepares and returns formatted object SEO id

Parameters
string$sTitleOriginal object title
bool$blSkipTruncateTruncate title into defined lenght or not
int$iLanglanguage ID, for which to prepare the title
Returns
string

Definition at line 647 of file oxseoencoder.php.

oxSeoEncoder::_prepareUri (   $sUri,
  $iLang = false 
)
protected

Makes safe seo uri - removes unsupported/reserved characters

Parameters
string$sUriseo uri
int$iLanglanguage ID, for which URI should be prepared
Returns
string

Definition at line 573 of file oxseoencoder.php.

oxSeoEncoder::_processSeoUrl (   $sSeoUrl,
  $sObjectId = null,
  $iLang = null,
  $blExclude = false 
)
protected

Processes seo url before saving to db:

  • oxseoencoder::addLanguageParam();
  • oxseoencoder::_getUniqueSeoUrl().
Parameters
string$sSeoUrlseo url to process
string$sObjectIdseo object id [optional]
int$iLangactive language id [optional]
bool$blExcludeexclude language prefix while building seo url
Returns
string

Definition at line 114 of file oxseoencoder.php.

oxSeoEncoder::_saveInCache (   $sCacheIdent,
  $sCache,
  $sType,
  $iLang = null,
  $iShopId = null,
  $sParams = null 
)
protected

Saves seo cache data for active view (in non admin mode)

Parameters
string$sCacheIdentcache identifier
string$sCachecacheable data
string$sTypeobject type
int$iLangactive language id
mixed$iShopIdactive shop id
string$sParamsadditional seo params. optional (mostly used for db indexing)
Returns
bool

Definition at line 447 of file oxseoencoder.php.

oxSeoEncoder::_saveToDb (   $sType,
  $sObjectId,
  $sStdUrl,
  $sSeoUrl,
  $iLang,
  $iShopId = null,
  $blFixed = null,
  $sParams = null 
)
protected

_saveToDb saves values to seo table

Parameters
string$sTypeurl type (static, dynamic, oxarticle etc)
string$sObjectIdobject identifier
string$sStdUrlstandard url
string$sSeoUrlseo url
int$iLangactive object language
mixed$iShopIdactive object shop id
bool$blFixedseo entry marker. if true, entry should not be automatically changed
string$sParamsadditional seo params. optional (mostly used for db indexing)

protected

Returns
void

Definition at line 694 of file oxseoencoder.php.

oxSeoEncoder::_trimUrl (   $sUrl,
  $iLang = null 
)
protected

Removes shop path part and session id from given url

Parameters
string$sUrlurl to clean bad chars
int$iLangactive language

protected

Returns
string

Definition at line 766 of file oxseoencoder.php.

oxSeoEncoder::addLanguageParam (   $sSeoUrl,
  $iLang 
)

Returns part of url defining active language

Parameters
string$sSeoUrlseo url
int$iLanglanguage id
Returns
string

Definition at line 89 of file oxseoencoder.php.

oxSeoEncoder::addSeoEntry (   $sObjectId,
  $iShopId,
  $iLang,
  $sStdUrl,
  $sSeoUrl,
  $sType,
  $blFixed = 1,
  $sKeywords = '',
  $sDescription = '',
  $sParams = '',
  $blExclude = false,
  $sAltObjectId = null 
)

Adds new seo entry to db

Parameters
string$sObjectIdobjects id
int$iShopIdshop id
int$iLangobjects language
string$sStdUrldefault url
string$sSeoUrlseo url
string$sTypeobject type
bool$blFixedmarker to keep seo config unchangeable
string$sKeywordsseo keywords
string$sDescriptionseo description
string$sParamsadditional seo params. optional (mostly used for db indexing)
bool$blExcludeexclude language prefix while building seo url
string$sAltObjectIdalternative object id used while saving meta info (used to override object id when saving tags related info)

Definition at line 1102 of file oxseoencoder.php.

oxSeoEncoder::copyStaticUrls (   $iShopId)

Method copies static urls from base shop to newly created

Parameters
int$iShopIdnew created shop id

Definition at line 1039 of file oxseoencoder.php.

oxSeoEncoder::deleteSeoEntry (   $sObjectId,
  $iShopId,
  $iLang,
  $sType 
)

Removes seo entry from db

Parameters
string$sObjectIdobjects id
int$iShopIdshop id
int$iLangobjects language
string$sTypeobject type

Definition at line 1150 of file oxseoencoder.php.

oxSeoEncoder::encodeStaticUrls (   $aStaticUrl,
  $iShopId,
  $iLang 
)

Static url encoder

Parameters
array$aStaticUrlstatic url info (contains standard URL and urls for each language)
int$iShopIdactive shop id
int$iLangactive language
Returns
null

Definition at line 966 of file oxseoencoder.php.

oxSeoEncoder::encodeString (   $sString,
  $blReplaceChars = true,
  $iLang = false 
)

Replaces special chars in text

Parameters
string$sStringstring to encode
bool$blReplaceCharsis true, replaces user defined (oxlang::getSeoReplaceChars) characters into alternative
int$iLanglanguage, for which to encode the string
Returns
string

Definition at line 816 of file oxseoencoder.php.

oxSeoEncoder::fetchSeoUrl (   $sStdUrl,
  $iLanguage = null 
)

Searches for seo url in seo table. If not found - FALSE is returned

Parameters
string$sStdUrlstandard url
integer$iLanguagelanguage
Returns
mixed

Definition at line 1207 of file oxseoencoder.php.

oxSeoEncoder::getDynamicObjectId (   $iShopId,
  $sStdUrl 
)

Generates dynamic url object id (calls oxseoencoder::_getStaticObjectId)

Parameters
int$iShopIdshop id
string$sStdUrlstandard (dynamic) url
Returns
string

Definition at line 170 of file oxseoencoder.php.

oxSeoEncoder::getDynamicUrl (   $sStdUrl,
  $sSeoUrl,
  $iLang 
)

getDynamicUrl acts similar to static urls, except, that dynamic url are not shown in admin and they can be re-encoded by providing new seo url

Parameters
string$sStdUrlstandard url
string$sSeoUrlpart of URL query which will be attached to standard shop url
int$iLangactive language

public

Returns
string

Definition at line 1190 of file oxseoencoder.php.

oxSeoEncoder::getMetaData (   $sObjectId,
  $sMetaType,
  $iShopId = null,
  $iLang = null 
)

Returns meta information for preferred object

Parameters
string$sObjectIdinformation object id
string$sMetaTypemetadata type - "oxkeywords", "oxdescription"
int$iShopIdactive shop id [optional]
int$iLangactive language [optional]
Returns
string

Definition at line 1167 of file oxseoencoder.php.

oxSeoEncoder::getStaticUrl (   $sStdUrl,
  $iLang = null,
  $iShopId = null 
)

Returns static url for passed standard link (if available)

Parameters
string$sStdUrlstandard Url
int$iLangactive language (optional). default null
int$iShopIdactive shop id (optional). default null
Returns
string

Definition at line 1062 of file oxseoencoder.php.

oxSeoEncoder::markAsExpired (   $sId,
  $iShopId = null,
  $iExpStat = 1,
  $iLang = null,
  $sParams = null 
)

Marks object seo records as expired

Parameters
string$sIdchanged object id. If null is passed, object dependency is not checked
int$iShopIdactive shop id. Shop id must be passed uf you want to do shop level update (default null)
int$iExpStatexpiration status: 1 - standard expiration
int$iLangactive language (optiona;)
string$sParamsadditional params

Definition at line 898 of file oxseoencoder.php.

oxSeoEncoder::setIdLength (   $iIdlength = null)

sets seo id length

Parameters
string$iIdlengthid length

Definition at line 870 of file oxseoencoder.php.

oxSeoEncoder::setPrefix (   $sPrefix)

Sets SEO prefix

Parameters
string$sPrefixSEO prefix

Definition at line 856 of file oxseoencoder.php.

oxSeoEncoder::setReservedWords (   $aReservedWords)

Sets array of words which must be checked before building seo url These words are appended by seo prefix if they are the initial uri segment

Parameters
array$aReservedWordsreserved words

Definition at line 883 of file oxseoencoder.php.

oxSeoEncoder::setSeparator (   $sSeparator = null)

Sets SEO separator

Parameters
string$sSeparatorSEO seperator

Definition at line 843 of file oxseoencoder.php.

Member Data Documentation

oxSeoEncoder::$_aCache = array()
staticprotected

Definition at line 72 of file oxseoencoder.php.

oxSeoEncoder::$_aFixedCache = array()
staticprotected

Url fixed state cache

Returns
array

Definition at line 58 of file oxseoencoder.php.

oxSeoEncoder::$_aReservedEntryKeys = null
staticprotected

Definition at line 23 of file oxseoencoder.php.

oxSeoEncoder::$_aReservedWords = array('admin')
staticprotected

Definition at line 16 of file oxseoencoder.php.

oxSeoEncoder::$_iIdLength = 255
protected

Definition at line 37 of file oxseoencoder.php.

oxSeoEncoder::$_iMaxUrlLength = null
protected

Definition at line 79 of file oxseoencoder.php.

oxSeoEncoder::$_sAddParams = null
protected

Definition at line 51 of file oxseoencoder.php.

oxSeoEncoder::$_sCacheKey = null
staticprotected

Definition at line 65 of file oxseoencoder.php.

oxSeoEncoder::$_sPrefix = null
staticprotected

Definition at line 44 of file oxseoencoder.php.

oxSeoEncoder::$_sSeparator = null
staticprotected

Definition at line 30 of file oxseoencoder.php.


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