Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Member Functions | Static Private Attributes | List of all members
eZURI Class Reference

## Public Member Functions
| __construct ( $uri)
| setURIString ( $uri, $fullInitialize=true)
| uriString ( $withLeadingSlash=false)
| originalURIString ( $withLeadingSlash=false)
| isEmpty ()
| element ( $index=0, $relative=true)
| elements ( $as_text=true)
| convertFilterString ()
| userParameters ()
| toBeginning ()
| toEnd ()
| increase ( $num=1)
| dropBase ()
| index ()
| base ( $as_text=true)
| matchBase (eZURI $uri)
| attributes ()
| hasAttribute ( $attr)
| attribute ( $attr)

## Static Public Member Functions
static | decodeIRI ( $str)
static | encodeIRI ( $str)
static | codecURL ( $url, $encode)
static | encodeURL ( $url)
static | decodeURL ( $url)
static | instance ( $uri=false)
static | transformURI (&$href, $ignoreIndexDir=false, $serverURL=null, $htmlEscape=true)
static | getTransformURIMode ()
static | setTransformURIMode ( $mode)

## Public Attributes
| $URI
| $OriginalURI
| $URIArray
| $Index
| $UserArray

## Static Private Member Functions
static | escapeHtmlTransformUri ( $href)

## Static Private Attributes
static | $transformURIMode = "relative"

## Detailed Description

Examples
  /web/vh/ezpublish.se7enx.com/doc/api.exponential.earth/src/exponential/kernel/classes/ezurlaliasml.php.

Definition at line 27 of file ezuri.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZURI::__construct | ( |  | $uri | ) |

Initializes with the URI string $uri. The URI string is split on / into an array.

Parameters

  string | $uri | the URI to use

Returns
  void

Definition at line 76 of file ezuri.php.

References setURIString().

## Member Function Documentation

## ◆ attribute()

eZURI::attribute | ( |  | $attr | ) |

Get value for an attribute

Parameters

  string | $attr |

Returns
  boolean the value for attribute $attr or null if it does not exist.

Definition at line 534 of file ezuri.php.

References base(), element(), elements(), index(), originalURIString(), eZSys\queryString(), uriString(), and eZDebug\writeError().

## ◆ attributes()

eZURI::attributes | ( |  | ) |

Export all attributes of the object

Returns
  array the attributes for the object

Definition at line 506 of file ezuri.php.

Referenced by hasAttribute().

## ◆ base()

eZURI::base | ( |  | $as_text = `true` | ) |

Return the elements before pointer

Parameters

  type | $as_text | return as text or array

Returns
  string|array the base string or the base elements as an array if $as_text is true.

Definition at line 459 of file ezuri.php.

Referenced by attribute().

## ◆ codecURL()

static eZURI::codecURL | ( |  | $url,
|  |  | $encode
| ) |  |
| static

Parse URL and encode/decode its path string

Parameters

  string | $url | the URL to parse
  boolean | $encode | tells to encode the URI

Returns
  string the parsed url

Definition at line 134 of file ezuri.php.

References decodeIRI(), and encodeIRI().

Referenced by decodeURL(), and encodeURL().

## ◆ convertFilterString()

eZURI::convertFilterString | ( |  | ) |

Converts filter string to current locale. When an user types in browser url like: "/content/view/full/2/(namefilter)/a" 'a' letter should be urldecoded and converted from utf-8 to current locale.

Returns
  string converted string

Definition at line 364 of file ezuri.php.

References eZTextCodec\instance().

Referenced by setURIString().

## ◆ decodeIRI()

static eZURI::decodeIRI | ( |  | $str | ) |
| static

Decodes a path string which is in IRI format and returns the new path in the internal encoding.

More info on IRI here: http://www.w3.org/International/O-URL-and-ident.html

Parameters

  string | $str | the string to decode

Returns
  string decoded version of $str

Definition at line 89 of file ezuri.php.

References eZTextCodec\instance().

Referenced by codecURL(), and setURIString().

## ◆ decodeURL()

static eZURI::decodeURL | ( |  | $url | ) |
| static

Decodes URL which has path string is in IRI format and returns the new URL with path in the internal encoding.

Parameters

  string | $url | url to decode

Returns
  string the decoded url

Definition at line 205 of file ezuri.php.

References codecURL().

## ◆ dropBase()

eZURI::dropBase | ( |  | ) |

Removes all elements below the current index, recreates the URI string and sets index to 0.

Returns
  void

Definition at line 429 of file ezuri.php.

References $URI.

Referenced by eZSiteAccess\match().

## ◆ element()

eZURI::element | ( |  | $index = `0`,
|  |  | $relative = `true`
| ) |  |

Get element index from uri

Parameters

  integer | $index | the index of URI to return
  boolean | $relative | if index is relative to the internal pointer

Returns
  string|null the element at $index

Examples
  /web/vh/ezpublish.se7enx.com/doc/api.exponential.earth/src/exponential/kernel/classes/ezurlaliasml.php.

Definition at line 328 of file ezuri.php.

References $Index.

Referenced by eZModule\accessAllowed(), attribute(), eZSiteAccess\match(), and eZURLAliasML\urlTranslationEnabledByUri().

## ◆ elements()

eZURI::elements | ( |  | $as_text = `true` | ) |

Return all URI elements

Parameters

  boolean | $as_text | return the elements as string

Returns
  array|string all elements as string/array depending on $as_text

Definition at line 345 of file ezuri.php.

Referenced by attribute(), and eZSiteAccess\match().

## ◆ encodeIRI()

static eZURI::encodeIRI | ( |  | $str | ) |
| static

Encodes path string in internal encoding to a new string which conforms to the IRI specification.

More info on IRI here: http://www.w3.org/International/O-URL-and-ident.html

Parameters

  string | $str | the IRI to encode

Returns
  string $str encoded as IRU

Definition at line 104 of file ezuri.php.

References eZTextCodec\instance().

Referenced by codecURL(), and eZSiteAccess\match().

## ◆ encodeURL()

static eZURI::encodeURL | ( |  | $url | ) |
| static

Encodes path string of URL in internal encoding to a new string which conforms to the IRI specification.

Parameters

  type | $url |

Returns
  string the encoded url

Definition at line 194 of file ezuri.php.

References codecURL().

Referenced by eZHTTPTool\redirect().

## ◆ escapeHtmlTransformUri()

static eZURI::escapeHtmlTransformUri | ( |  | $href | ) |
| static private

Encoding cleanup used by transformURI. Extracted in a private method to avoid duplicated code.

Parameters

  string | $href |

Returns
  string

Definition at line 666 of file ezuri.php.

Referenced by transformURI().

## ◆ getTransformURIMode()

static eZURI::getTransformURIMode | ( |  | ) |
| static

Returns the current mode used for transformURI().

See also
  transformURI()
  setTransformURIMode()

Returns
  string

Definition at line 679 of file ezuri.php.

References $transformURIMode.

Referenced by eZURLOperator\urlTransformation().

## ◆ hasAttribute()

eZURI::hasAttribute | ( |  | $attr | ) |

Check if attribute exsits

Parameters

  string | $attr | the attrbiute to check if exists

Returns
  boolean

Definition at line 523 of file ezuri.php.

References attributes().

## ◆ increase()

eZURI::increase | ( |  | $num = `1` | ) |

Moves the index 1 step up or $num if specified.

Parameters

  int | $num | number of steps to move pointer

Returns
  void

Definition at line 416 of file ezuri.php.

Referenced by eZSiteAccess\match().

## ◆ index()

eZURI::index | ( |  | ) |

Return the current position of pointer

Returns
  int the current pointer position.

Definition at line 448 of file ezuri.php.

References $Index.

Referenced by attribute().

## ◆ instance()

static eZURI::instance | ( |  | $uri = `false` | ) |
| static

Returns a shared instance of the eZURI class IF $uri is false or the same as current request uri, if not then a new non shared instance is created.

Parameters

  bool | string | $uri | Shared uri instance if false

Returns
  eZURI

Definition at line 574 of file ezuri.php.

References eZSys\requestURI().

## ◆ isEmpty()

eZURI::isEmpty | ( |  | ) |

Check if there URI is set

Returns
  boolean true if the URI is empty, ie it's equal to / or empty string.

Examples
  /web/vh/ezpublish.se7enx.com/doc/api.exponential.earth/src/exponential/kernel/classes/ezurlaliasml.php.

Definition at line 316 of file ezuri.php.

Referenced by eZURLAliasML\urlTranslationEnabledByUri().

## ◆ matchBase()

eZURI::matchBase | ( | eZURI | $uri | ) |

Tries to match the base of $uri against this base and returns the result. A match is made if all elements of this object match the base elements of the $uri object, this means that $uri's base may be longer than this base but not shorter.

Parameters

  eZURI | $uri | the uri to match against

Returns
  boolean

Definition at line 480 of file ezuri.php.

## ◆ originalURIString()

eZURI::originalURIString | ( |  | $withLeadingSlash = `false` | ) |

Return the original URI

the URI will not include the leading / if $withLeadingSlash is true.

Parameters

  boolean | $withLeadingSlash | prefix the uri with /

Returns
  string the URI passed to the object with user parameters (if any).

Definition at line 303 of file ezuri.php.

References $OriginalURI.

Referenced by attribute().

## ◆ setTransformURIMode()

static eZURI::setTransformURIMode | ( |  | $mode | ) |
| static

Sets the current mode used for transformURI() to $mode.

See also
  transformURI()
  getTransformURIMode()

Parameters

  string | $mode |

Definition at line 692 of file ezuri.php.

## ◆ setURIString()

eZURI::setURIString | ( |  | $uri,
|  |  | $fullInitialize = `true`
| ) |  |

Sets uri string for instance

Sets the current URI string to $uri, the URI is then split into array elements and index reset to 1.

Parameters

  string | $uri |
  boolean | $fullInitialize |

Returns
  void

Definition at line 220 of file ezuri.php.

References convertFilterString(), and decodeIRI().

Referenced by __construct(), and eZSiteAccess\match().

## ◆ toBeginning()

eZURI::toBeginning | ( |  | ) |

Reset the internal pointer

Returns
  void

Definition at line 395 of file ezuri.php.

## ◆ toEnd()

eZURI::toEnd | ( |  | ) |

Moves the index to the end.

Returns
  void

Definition at line 405 of file ezuri.php.

## ◆ transformURI()

static eZURI::transformURI | ( | & | $href,
|  |  | $ignoreIndexDir = `false`,
|  |  | $serverURL = `null`,
|  |  | $htmlEscape = `true`
| ) |  |
| static

Implementation of an 'ezurl' template operator Makes valid eZ Publish urls to use in links

Parameters

  string | &$href |
  boolean | $ignoreIndexDir |
  string | $serverURL | full|relative
  boolean | $htmlEscape | true to html escape the result for HTML

Returns
  string the link to use

Definition at line 599 of file ezuri.php.

References $transformURIMode, escapeHtmlTransformUri(), eZClusterFileHandler\instance(), and eZSys\instance().

Referenced by eZRSSExport\generateFeed(), eZTemplatesStatisticsReporter\generateStatistics(), eZURLOperator\modify(), eZDebug\printReport(), and eZURLOperator\urlTransformation().

## ◆ uriString()

eZURI::uriString | ( |  | $withLeadingSlash = `false` | ) |

Get the uri string

The URI will not include the leading / if $withLeadingSlash is true.

Parameters

  boolean | $withLeadingSlash | prefix the uri with /

Returns
  string the URI passed as to the object

Definition at line 287 of file ezuri.php.

References $URI.

Referenced by attribute().

## ◆ userParameters()

eZURI::userParameters | ( |  | ) |

Get user variables

Returns
  array all the user defined variables

Definition at line 385 of file ezuri.php.

References $UserArray.

## Member Data Documentation

## ◆ $Index

eZURI::$Index

Definition at line 50 of file ezuri.php.

Referenced by element(), and index().

## ◆ $OriginalURI

eZURI::$OriginalURI

Definition at line 36 of file ezuri.php.

Referenced by originalURIString().

## ◆ $transformURIMode

eZURI::$transformURIMode = "relative"
| static private

Definition at line 68 of file ezuri.php.

Referenced by getTransformURIMode(), and transformURI().

## ◆ $URI

eZURI::$URI

Definition at line 34 of file ezuri.php.

Referenced by dropBase(), and uriString().

## ◆ $URIArray

eZURI::$URIArray

Definition at line 43 of file ezuri.php.

## ◆ $UserArray

eZURI::$UserArray

Definition at line 57 of file ezuri.php.

Referenced by userParameters().

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

- ezuri.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.