Exponential Basic 2.4.0.1 Exponential Basic 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

Definition at line 28 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 77 of file ezuri.php.

References $uri, and 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 535 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 507 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 460 of file ezuri.php.

References $elements, and Index.

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 135 of file ezuri.php.

References $url, 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 365 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 90 of file ezuri.php.

References $str, and 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 206 of file ezuri.php.

References $url, and 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 430 of file ezuri.php.

References $elements, $name, $uri, $URI, and Index.

## ◆ 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

Definition at line 329 of file ezuri.php.

References $index, $Index, and $ret.

Referenced by attribute().

## ◆ 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 346 of file ezuri.php.

References $elements, and Index.

Referenced by attribute().

## ◆ 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 105 of file ezuri.php.

References $i, $str, $tmp, and 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 195 of file ezuri.php.

References $url, and codecURL().

Referenced by ezpbKernelAdmin\redirect(), ezpbKernelWeb\redirect(), and ezpKernelWeb\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 662 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 675 of file ezuri.php.

References $transformURIMode.

## ◆ hasAttribute()

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

Check if attribute exsits

Parameters

  string | $attr | the attrbiute to check if exists

Returns
  boolean

Definition at line 524 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 417 of file ezuri.php.

References Index.

## ◆ index()

eZURI::index | ( |  | ) |

Return the current position of pointer

Returns
  int the current pointer position.

Definition at line 449 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 575 of file ezuri.php.

References $uri, and eZSys\requestURI().

Referenced by ezpbKernelAdmin\__construct(), ezpbKernelWeb\__construct(), ezpKernelTreeMenu\__construct(), ezpKernelWeb\__construct(), ezpKernelRest\__construct(), ezpbKernelAdmin\dispatchLoop(), ezpbKernelWeb\dispatchLoop(), ezpKernelWeb\dispatchLoop(), ezpbKernelAdmin\redirect(), ezpbKernelWeb\redirect(), ezpKernelWeb\redirect(), ezpbKernelAdmin\requestInit(), ezpbKernelWeb\requestInit(), and ezpKernelWeb\requestInit().

## ◆ 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.

Definition at line 317 of file ezuri.php.

## ◆ 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 481 of file ezuri.php.

References $i, and $uri.

## ◆ 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 304 of file ezuri.php.

References $OriginalURI, and $uri.

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 688 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 221 of file ezuri.php.

References $uri, convertFilterString(), decodeIRI(), and Index.

Referenced by __construct().

## ◆ toBeginning()

eZURI::toBeginning | ( |  | ) |

Reset the internal pointer

Returns
  void

Definition at line 396 of file ezuri.php.

References Index.

## ◆ toEnd()

eZURI::toEnd | ( |  | ) |

Moves the index to the end.

Returns
  void

Definition at line 406 of file ezuri.php.

References Index.

## ◆ 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 600 of file ezuri.php.

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

Referenced by eZDebug\printReport(), and ezpLanguageSwitcher\process().

## ◆ 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 288 of file ezuri.php.

References $uri, and $URI.

Referenced by attribute().

## ◆ userParameters()

eZURI::userParameters | ( |  | ) |

Get user variables

Returns
  array all the user defined variables

Definition at line 386 of file ezuri.php.

References $UserArray.

## Member Data Documentation

## ◆ $Index

eZURI::$Index

Definition at line 51 of file ezuri.php.

Referenced by element(), and index().

## ◆ $OriginalURI

eZURI::$OriginalURI

Definition at line 37 of file ezuri.php.

Referenced by originalURIString().

## ◆ $transformURIMode

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

Definition at line 69 of file ezuri.php.

Referenced by getTransformURIMode(), and transformURI().

## ◆ $URI

eZURI::$URI

Definition at line 35 of file ezuri.php.

Referenced by dropBase(), and uriString().

## ◆ $URIArray

eZURI::$URIArray

Definition at line 44 of file ezuri.php.

## ◆ $UserArray

eZURI::$UserArray

Definition at line 58 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+.