Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
HTTP(S) URI handler
CHAR_ALNUM = 'A-Za-z0-9'
Character classes for validation regular expressions
CHAR_MARK = '-_.!~*\'()\[\]'
CHAR_RESERVED = ';\/?:@&=+$,'
CHAR_SEGMENT = ':@&=+$,;'
CHAR_UNWISE = '{}|\\\\^`'
string $_fragment = ''
HTTP fragment
string $_host = ''
HTTP host
string $_password = ''
HTTP password
string $_path = ''
HTTP part
string $_port = ''
HTTP post
string $_query = ''
HTTP query
array $_regex = 'array'
Regular expression grammar rules for validation; values added by constructor
string $_username = ''
HTTP username
__construct(
string $scheme, string $schemeSpecific
)
:
Constructor accepts a string $scheme (e.g., http, https) and a scheme-specific part of the URI (e.g., example.com/path/to/resource?query=param#fragment)
_parseUri(
string $schemeSpecific
)
:
void
Parse the scheme-specific portion of the URI and place its parts into instance variables.
addReplaceQueryParameters(
array $queryParams
)
:
string
Add or replace params in the query string for the current URI, and return the old query.
fromString(
string $uri
)
:
Zend_Uri_Http
Creates a Zend_Uri_Http from the given string
getFragment(
)
:
string|false
Returns the fragment portion of the URL (after #), or FALSE if none.
getHost(
)
:
string
Returns the domain or host IP portion of the URL, or FALSE if none.
getPassword(
)
:
string
Returns the password portion of the URL, or FALSE if none.
getPath(
)
:
string
Returns the path and filename portion of the URL, or FALSE if none.
getPort(
)
:
string
Returns the TCP port, or FALSE if none.
getQuery(
)
:
string
Returns the query portion of the URL (after ?), or FALSE if none.
getQueryAsArray(
)
:
array
Returns the query portion of the URL (after ?) as a key-value-array. If the query is empty an empty array is returned
getUri(
)
:
string
Returns a URI based on current values of the instance variables. If any part of the URI does not pass validation, then an exception is thrown.
getUsername(
)
:
string
Returns the username portion of the URL, or FALSE if none.
removeQueryParameters(
array $queryParamKeys
)
:
string
Remove params in the query string for the current URI, and return the old query.
setFragment(
string $fragment
)
:
string
Sets the fragment for the current URI, and returns the old fragment
setHost(
string $host
)
:
string
Sets the host for the current URI, and returns the old host
setPassword(
string $password
)
:
string
Sets the password for the current URI, and returns the old password
setPath(
string $path
)
:
string
Sets the path for the current URI, and returns the old path
setPort(
string $port
)
:
string
Sets the port for the current URI, and returns the old port
setQuery(
string|array $query
)
:
string
Set the query string for the current URI, and return the old query string This method accepts both strings and arrays.
setUsername(
string $username
)
:
string
Sets the username for the current URI, and returns the old username
valid(
)
:
boolean
Validate the current URI from the instance variables. Returns true if and only if all parts pass validation.
validateFragment(
string $fragment
=
null
)
:
boolean
Returns true if and only if the fragment passes validation. If no fragment is passed, then the fragment contained in the instance variable is used.
validateHost(
string $host
=
null
)
:
boolean
Returns true if and only if the host string passes validation. If no host is passed, then the host contained in the instance variable is used.
validatePassword(
string $password
=
null
)
:
boolean
Returns true if and only if the password passes validation. If no password is passed, then the password contained in the instance variable is used.
validatePath(
string $path
=
null
)
:
boolean
Returns true if and only if the path string passes validation. If no path is passed, then the path contained in the instance variable is used.
validatePort(
string $port
=
null
)
:
boolean
Returns true if and only if the TCP port string passes validation. If no port is passed, then the port contained in the instance variable is used.
validateQuery(
string $query
=
null
)
:
boolean
Returns true if and only if the query string passes validation. If no query is passed, then the query string contained in the instance variable is used.
validateUsername(
string $username
=
null
)
:
boolean
Returns true if and only if the username passes validation. If no username is passed, then the username contained in the instance variable is used.