OXID eShop CE  6.1.5
OxidEsales\EshopCommunity\Core\UtilsUrl Class Reference
+ Inheritance diagram for OxidEsales\EshopCommunity\Core\UtilsUrl:
+ Collaboration diagram for OxidEsales\EshopCommunity\Core\UtilsUrl:

Public Member Functions

 getBaseAddUrlParams ()
 
 getAddUrlParams ()
 
 prepareUrlForNoSession ($sUrl)
 
 prepareCanonicalUrl ($sUrl)
 
 appendUrl ($sUrl, $parametersToAdd, $blFinalUrl=false, $allowParameterOverwrite=false)
 
 cleanUrl ($sUrl, $aParams=null)
 
 addShopHost ($sUrl)
 
 processUrl ($sUrl, $blFinalUrl=true, $aParams=null, $iLang=null)
 
 processShopUrl ($sUrl, $blFinalUrl=true, $iLang=null)
 
 getActiveShopHost ()
 
 extractHost ($url)
 
 getActiveShopUrlPath ()
 
 extractUrlPath ($shopUrl)
 
 isCurrentShopHost ($sUrl)
 
 processSeoUrl ($sUrl)
 
 cleanUrlParams ($sUrl, $sConnector='&')
 
 appendParamSeparator ($sUrl)
 
 getCurrentUrl ()
 
 stringToParamsArray ($sValue)
 
 getUrlLanguageParameter ($languageId)
 

Public Attributes

const PARAMETER_SEPARATOR = '&'
 

Protected Member Functions

 _addHost ($sUrl, &$aHosts)
 
 _addLanguageHost ($aLanguageUrls, &$aHosts)
 
 _getHosts ()
 
 _addMallHosts (&$aHosts)
 

Protected Attributes

 $_aAddUrlParams = null
 
 $_aHosts = null
 

Private Member Functions

 parseUrlAndAppendSchema ($url, $flag, $appendScheme='http')
 
 getUrlParametersSeparator ($url)
 
 removeNotSetParameters ($parametersToAdd)
 
 mergeDuplicatedParameters ($aAddParams, $query, $allowParameterOverwrite=true)
 
 rightTrimAmp ($url)
 

Detailed Description

URL utility class

Member Function Documentation

◆ _addHost()

OxidEsales\EshopCommunity\Core\UtilsUrl::_addHost (   $sUrl,
$aHosts 
)
protected

Extracts host from given url and appends $aHosts with it

Parameters
string$sUrlurl to extract
array$aHostshosts array

◆ _addLanguageHost()

OxidEsales\EshopCommunity\Core\UtilsUrl::_addLanguageHost (   $aLanguageUrls,
$aHosts 
)
protected

Appends language urls to $aHosts.

Parameters
array$aLanguageUrlsarray of language urls to extract
array$aHostshosts array

◆ _addMallHosts()

OxidEsales\EshopCommunity\Core\UtilsUrl::_addMallHosts ( $aHosts)
protected

Appends shop mall urls to $aHosts if needed

Parameters
array$aHostshosts array

◆ _getHosts()

OxidEsales\EshopCommunity\Core\UtilsUrl::_getHosts ( )
protected

Collects and returns current shop hosts array.

Returns
array

◆ addShopHost()

OxidEsales\EshopCommunity\Core\UtilsUrl::addShopHost (   $sUrl)

Adds shop host if url does not start with it.

Parameters
string$sUrl
Returns
string

◆ appendParamSeparator()

OxidEsales\EshopCommunity\Core\UtilsUrl::appendParamSeparator (   $sUrl)

Appends parameter separator - '?' if it is not in the url or & otherwise.

Parameters
string$sUrlurl
Returns
string

◆ appendUrl()

OxidEsales\EshopCommunity\Core\UtilsUrl::appendUrl (   $sUrl,
  $parametersToAdd,
  $blFinalUrl = false,
  $allowParameterOverwrite = false 
)

Appends url with given parameters.

Parameters
string$sUrlurl to append
array$parametersToAddparameters to append
bool$blFinalUrlfinal url
bool$allowParameterOverwriteDecides if same parameters should overwrite query parameters.
Returns
string

◆ cleanUrl()

OxidEsales\EshopCommunity\Core\UtilsUrl::cleanUrl (   $sUrl,
  $aParams = null 
)

Removes any or specified dynamic parameter from given url.

Parameters
string$sUrlurl to clean.
array$aParamsparameters to remove [optional].
Returns
string

◆ cleanUrlParams()

OxidEsales\EshopCommunity\Core\UtilsUrl::cleanUrlParams (   $sUrl,
  $sConnector = '&' 
)

Remove duplicate GET parameters and clean & and duplicate &.

Parameters
string$sUrlurl to process.
string$sConnectorGET elements connector.
Returns
string

◆ extractHost()

OxidEsales\EshopCommunity\Core\UtilsUrl::extractHost (   $url)

Extract host from url.

Parameters
string$url
Returns
string

◆ extractUrlPath()

OxidEsales\EshopCommunity\Core\UtilsUrl::extractUrlPath (   $shopUrl)

Method returns URL part - path.

Parameters
string$shopUrl
Returns
string|null

◆ getActiveShopHost()

OxidEsales\EshopCommunity\Core\UtilsUrl::getActiveShopHost ( )

Method returns active shop host.

Returns
string

◆ getActiveShopUrlPath()

OxidEsales\EshopCommunity\Core\UtilsUrl::getActiveShopUrlPath ( )

Method returns shop URL part - path.

Returns
null|string

◆ getAddUrlParams()

OxidEsales\EshopCommunity\Core\UtilsUrl::getAddUrlParams ( )

Returns parameters which should be appended to seo or std url.

Returns
array

◆ getBaseAddUrlParams()

OxidEsales\EshopCommunity\Core\UtilsUrl::getBaseAddUrlParams ( )

Returns core parameters which must be added to each url.

Returns
array

◆ getCurrentUrl()

OxidEsales\EshopCommunity\Core\UtilsUrl::getCurrentUrl ( )

Return current url.

Returns
string

◆ getUrlLanguageParameter()

OxidEsales\EshopCommunity\Core\UtilsUrl::getUrlLanguageParameter (   $languageId)

Return array of language key and language value.

Parameters
integer$languageId
Returns
array

◆ getUrlParametersSeparator()

OxidEsales\EshopCommunity\Core\UtilsUrl::getUrlParametersSeparator (   $url)
private

Returns url separator (?,&) for adding new parameters.

Parameters
string$url
Returns
string

◆ isCurrentShopHost()

OxidEsales\EshopCommunity\Core\UtilsUrl::isCurrentShopHost (   $sUrl)

Compares current URL to supplied string.

Parameters
string$sUrl
Returns
bool true if $sUrl is equal to current page URL.

◆ mergeDuplicatedParameters()

OxidEsales\EshopCommunity\Core\UtilsUrl::mergeDuplicatedParameters (   $aAddParams,
  $query,
  $allowParameterOverwrite = true 
)
private
Parameters
array$aAddParamsparameters to add to URL
string$queryURL query part
bool$allowParameterOverwriteDecides if same parameters should overwrite query parameters
Returns
array

◆ parseUrlAndAppendSchema()

OxidEsales\EshopCommunity\Core\UtilsUrl::parseUrlAndAppendSchema (   $url,
  $flag,
  $appendScheme = 'http' 
)
private

Improved url parsing with parse_url as base and scheme checking improvement in url preprocessing

Parameters
string$url
string$flag
string$appendSchemeAppend this scheme to url if no scheme found
Returns
string

◆ prepareCanonicalUrl()

OxidEsales\EshopCommunity\Core\UtilsUrl::prepareCanonicalUrl (   $sUrl)

Prepares canonical url.

Parameters
string$sUrlgiven url

@access public

Returns
string

◆ prepareUrlForNoSession()

OxidEsales\EshopCommunity\Core\UtilsUrl::prepareUrlForNoSession (   $sUrl)

prepareUrlForNoSession adds extra url params making it usable without session also removes sid=xxxx&.

Parameters
string$sUrlgiven url

@access public

Returns
string

◆ processSeoUrl()

OxidEsales\EshopCommunity\Core\UtilsUrl::processSeoUrl (   $sUrl)

Seo url processor: adds various needed parameters, like currency, shop id.

Parameters
string$sUrlurl to process.
Returns
string

◆ processShopUrl()

OxidEsales\EshopCommunity\Core\UtilsUrl::processShopUrl (   $sUrl,
  $blFinalUrl = true,
  $iLang = null 
)

Adds additional shop url parameters, session id, language id when needed.

Parameters
string$sUrlurl to process.
bool$blFinalUrlshould url be finalized or should it end with ? or &.
int$iLangurl target language.
Returns
string

◆ processUrl()

OxidEsales\EshopCommunity\Core\UtilsUrl::processUrl (   $sUrl,
  $blFinalUrl = true,
  $aParams = null,
  $iLang = null 
)

Performs base url processing - adds required parameters to given url.

Parameters
string$sUrlurl to process.
bool$blFinalUrlshould url be finalized or should it end with ? or & (default true).
array$aParamsadditional parameters (default null).
int$iLangurl target language (default null).
Returns
string

◆ removeNotSetParameters()

OxidEsales\EshopCommunity\Core\UtilsUrl::removeNotSetParameters (   $parametersToAdd)
private

Removes parameters which are not set.

Parameters
string$parametersToAdd
Returns
string

◆ rightTrimAmp()

OxidEsales\EshopCommunity\Core\UtilsUrl::rightTrimAmp (   $url)
private
Parameters
string$url
Returns
string

◆ stringToParamsArray()

OxidEsales\EshopCommunity\Core\UtilsUrl::stringToParamsArray (   $sValue)

Forms parameters array out of a string. Takes & and & as delimiters. Returns associative array with parameters.

Parameters
string$sValueString
Returns
array

Member Data Documentation

◆ $_aAddUrlParams

OxidEsales\EshopCommunity\Core\UtilsUrl::$_aAddUrlParams = null
protected

◆ $_aHosts

OxidEsales\EshopCommunity\Core\UtilsUrl::$_aHosts = null
protected

◆ PARAMETER_SEPARATOR

const OxidEsales\EshopCommunity\Core\UtilsUrl::PARAMETER_SEPARATOR = '&'

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