dmBridge PHP API
DMURI Class Reference
Inheritance diagram for DMURI:

Public Member Functions

Static Public Member Functions

Protected Attributes


Detailed Description

Encapsulates an RFC 2396 Uniform Resource Identifier (URI), a superset of a URL.

GET data is available via the getQuery() methods. Note that unlike the PHP $_GET superglobal, getQuery() supports multiple identically named keys.

Author:
Alex Dolski <alex.dolski@unlv.edu> http://www.opensource.org/licenses/mit-license.php

Definition at line 20 of file DMURI.php.


Constructor & Destructor Documentation

DMURI::__construct ( uri = null)
Parameters:
stringuri
Exceptions:
DMIllegalArgumentExceptionif $uri is not a URI

Definition at line 76 of file DMURI.php.


Member Function Documentation

DMURI::__toString ( )
Returns:
string The string representation of the URI, or null if the URI is invalid.

Definition at line 86 of file DMURI.php.

Referenced by equals(), and isValid().

DMURI::addQueryValue ( key,
value 
)

Adds the given key/value pair to the query.

Multiple identical keys can be added. Null values will not be added.

Parameters:
stringkey Unencoded key
stringvalue Unencoded value
See also:
setQueryValue()

Definition at line 233 of file DMURI.php.

Referenced by setQueryString(), setQueryValue(), setString(), and DMInternalURI::setString().

DMURI::equals ( obj)
Parameters:
objectobj
Returns:
boolean

Definition at line 94 of file DMURI.php.

DMURI::getAbsoluteHostURI ( )

The absolute URI of the host, including only scheme, host, and port.

Returns:
DMURI

Definition at line 139 of file DMURI.php.

DMURI::getAbsoluteURIAsString ( )
Returns:
string The string representation of the URI, or null if the URI is invalid.

Reimplemented in DMInternalURI.

Definition at line 105 of file DMURI.php.

Referenced by __toString().

DMURI::getFragment ( )
Returns:
string The fragment component of the URI

Definition at line 151 of file DMURI.php.

Referenced by getAbsoluteURIAsString().

DMURI::getHost ( )
Returns:
string

Definition at line 165 of file DMURI.php.

Referenced by getAbsoluteHostURI(), getAbsoluteURIAsString(), and DMInternalURI::getAbsoluteURIAsString().

static DMURI::getLocalURIWithPath ( path) [static]
Parameters:
stringpath
Returns:
DMURI

Definition at line 66 of file DMURI.php.

Referenced by DMControlPanelTemplateHelper::getHtmlMainMenu().

DMURI::getPassword ( )
Returns:
string

Definition at line 179 of file DMURI.php.

Referenced by getAbsoluteURIAsString(), and isValid().

DMURI::getPath ( )
Returns:
string

Definition at line 193 of file DMURI.php.

Referenced by getAbsoluteURIAsString(), and DMInternalURI::getParams().

DMURI::getPathComponents ( )
Returns:
array Array of path components

Definition at line 207 of file DMURI.php.

DMURI::getPort ( )
Returns:
int

Definition at line 214 of file DMURI.php.

Referenced by getAbsoluteHostURI(), and getAbsoluteURIAsString().

DMURI::getQuery ( )
Returns:
array Array of arrays, each with "key" and "value" keys. This is not a simple one-dimensional associative array because a URI query may have multiple identically-named keys.
See also:
getQueryValue()
getQueryValues()

Definition at line 249 of file DMURI.php.

Referenced by getAbsoluteURIAsString().

DMURI::getQueryString ( )
Returns:
string The encoded URI query string, without preceding question mark

Definition at line 257 of file DMURI.php.

Referenced by getAbsoluteURIAsString().

DMURI::getQueryValue ( key)
Parameters:
stringkey
Returns:
string The value of the first query whose key matches $key.
See also:
getQuery()
getQueryValues()

Definition at line 389 of file DMURI.php.

DMURI::getQueryValues ( key)
Parameters:
stringkey
Returns:
array Array of values for every key matching $key.
See also:
getQuery()
getQueryValue()

Definition at line 404 of file DMURI.php.

DMURI::getScheme ( )
Returns:
string

Definition at line 294 of file DMURI.php.

Referenced by getAbsoluteHostURI(), getAbsoluteURIAsString(), DMInternalURI::getAbsoluteURIAsString(), and isValid().

DMURI::getUser ( )
Returns:
string

Definition at line 354 of file DMURI.php.

Referenced by getAbsoluteURIAsString(), and isValid().

DMURI::isValid ( )
Returns:
boolean

Definition at line 368 of file DMURI.php.

DMURI::setFragment ( fragment)
Parameters:
stringfragment

Definition at line 158 of file DMURI.php.

Referenced by setString(), and DMInternalURI::setString().

DMURI::setHost ( host)
Parameters:
stringhost The host part of the URI

Definition at line 172 of file DMURI.php.

Referenced by setString(), and DMInternalURI::setString().

DMURI::setPassword ( password)
Parameters:
stringpassword The password part of the URI

Definition at line 186 of file DMURI.php.

Referenced by setString(), and DMInternalURI::setString().

DMURI::setPath ( path)
Parameters:
stringpath The path part of the URI

Definition at line 200 of file DMURI.php.

Referenced by DMInternalURI::setParams(), setString(), and DMInternalURI::setString().

DMURI::setPort ( port)
Parameters:
intport The TCP port part of the URI

Definition at line 221 of file DMURI.php.

Referenced by setString(), and DMInternalURI::setString().

DMURI::setQueryString ( str)
Parameters:
stringstr Non-URL-encoded query string

Definition at line 268 of file DMURI.php.

DMURI::setQueryValue ( key,
value 
)

Unsets all key/value pairs whose key matches $key, and adds the given key/value pair to the query.

Parameters:
stringkey Unencoded key
stringvalue Unencoded value
See also:
addQueryVariable()

Definition at line 286 of file DMURI.php.

DMURI::setScheme ( scheme)
Parameters:
stringscheme The scheme part of the URI, e.g. "http"

Definition at line 301 of file DMURI.php.

Referenced by setString(), and DMInternalURI::setString().

DMURI::setString ( str)
Parameters:
stringstr
Exceptions:
DMIllegalArgumentExceptionif $str is not a valid URI

Reimplemented in DMInternalURI.

Definition at line 309 of file DMURI.php.

Referenced by __construct().

DMURI::setUser ( user)
Parameters:
stringuser The user part of the URI (optional)

Definition at line 361 of file DMURI.php.

Referenced by setString(), and DMInternalURI::setString().

DMURI::unsetQueryKey ( key)

Unsets all query variables having a key of $key.

Parameters:
stringkey

Definition at line 426 of file DMURI.php.

Referenced by setQueryValue().


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables