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
Details CHAR_MARK = '-_.!~*\'()\[\]'
Details CHAR_RESERVED = ';\/?:@&=+$,'
Details CHAR_SEGMENT = ':@&=+$,;'
Details CHAR_UNWISE = '{}|\\\\^`'
Detailsstring $_fragment = ''HTTP fragment
Detailsstring $_host = ''HTTP host
Detailsstring $_password = ''HTTP password
Detailsstring $_path = ''HTTP part
Detailsstring $_port = ''HTTP post
Detailsstring $_query = ''HTTP query
Detailsarray $_regex = 'array'Regular expression grammar rules for validation; values added by constructor
Detailsstring $_username = ''HTTP username
Details__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)
Details_parseUri(
string $schemeSpecific
)
:
voidParse the scheme-specific portion of the URI and place its parts into instance variables.
DetailsaddReplaceQueryParameters(
array $queryParams
)
:
stringAdd or replace params in the query string for the current URI, and return the old query.
DetailsfromString(
string $uri
)
:
Zend_Uri_HttpCreates a Zend_Uri_Http from the given string
DetailsgetFragment(
)
:
string|falseReturns the fragment portion of the URL (after #), or FALSE if none.
DetailsgetHost(
)
:
stringReturns the domain or host IP portion of the URL, or FALSE if none.
DetailsgetPassword(
)
:
stringReturns the password portion of the URL, or FALSE if none.
DetailsgetPath(
)
:
stringReturns the path and filename portion of the URL, or FALSE if none.
DetailsgetPort(
)
:
stringReturns the TCP port, or FALSE if none.
DetailsgetQuery(
)
:
stringReturns the query portion of the URL (after ?), or FALSE if none.
DetailsgetQueryAsArray(
)
:
arrayReturns the query portion of the URL (after ?) as a key-value-array. If the query is empty an empty array is returned
DetailsgetUri(
)
:
stringReturns 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.
DetailsgetUsername(
)
:
stringReturns the username portion of the URL, or FALSE if none.
DetailsremoveQueryParameters(
array $queryParamKeys
)
:
stringRemove params in the query string for the current URI, and return the old query.
DetailssetFragment(
string $fragment
)
:
stringSets the fragment for the current URI, and returns the old fragment
DetailssetHost(
string $host
)
:
stringSets the host for the current URI, and returns the old host
DetailssetPassword(
string $password
)
:
stringSets the password for the current URI, and returns the old password
DetailssetPath(
string $path
)
:
stringSets the path for the current URI, and returns the old path
DetailssetPort(
string $port
)
:
stringSets the port for the current URI, and returns the old port
DetailssetQuery(
string|array $query
)
:
stringSet the query string for the current URI, and return the old query string This method accepts both strings and arrays.
DetailssetUsername(
string $username
)
:
stringSets the username for the current URI, and returns the old username
Detailsvalid(
)
:
booleanValidate the current URI from the instance variables. Returns true if and only if all parts pass validation.
DetailsvalidateFragment(
string $fragment
=
null
)
:
booleanReturns true if and only if the fragment passes validation. If no fragment is passed, then the fragment contained in the instance variable is used.
DetailsvalidateHost(
string $host
=
null
)
:
booleanReturns 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.
DetailsvalidatePassword(
string $password
=
null
)
:
booleanReturns true if and only if the password passes validation. If no password is passed, then the password contained in the instance variable is used.
DetailsvalidatePath(
string $path
=
null
)
:
booleanReturns 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.
DetailsvalidatePort(
string $port
=
null
)
:
booleanReturns 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.
DetailsvalidateQuery(
string $query
=
null
)
:
booleanReturns 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.
DetailsvalidateUsername(
string $username
=
null
)
:
booleanReturns true if and only if the username passes validation. If no username is passed, then the username contained in the instance variable is used.
Details