![]() |
TYPO3
7.6
|
Public Member Functions | |
| __construct ($url, array $options=array()) | |
| __set ($var, $arg) | |
| __get ($var) | |
| getScheme () | |
| setScheme ($scheme) | |
| getUser () | |
| getPassword () | |
| getUserinfo () | |
| setUserinfo ($userinfo, $password=false) | |
| getHost () | |
| setHost ($host) | |
| getPort () | |
| setPort ($port) | |
| getAuthority () | |
| setAuthority ($authority) | |
| getPath () | |
| setPath ($path) | |
| getQuery () | |
| setQuery ($query) | |
| getFragment () | |
| setFragment ($fragment) | |
| getQueryVariables () | |
| setQueryVariables (array $array) | |
| setQueryVariable ($name, $value) | |
| unsetQueryVariable ($name) | |
| getURL () | |
| __toString () | |
| getNormalizedURL () | |
| normalize () | |
| isAbsolute () | |
| resolve ($reference) | |
| getOption ($optionName) | |
Static Public Member Functions | |
| static | removeDotSegments ($path) |
| static | urlencode ($string) |
| static | getCanonical () |
| static | getRequestedURL () |
| static | getRequested () |
Public Attributes | |
| const | OPTION_STRICT = 'strict' |
| const | OPTION_USE_BRACKETS = 'use_brackets' |
| const | OPTION_DROP_SEQUENCE = 'drop_sequence' |
| const | OPTION_ENCODE_KEYS = 'encode_keys' |
| const | OPTION_SEPARATOR_INPUT = 'input_separator' |
| const | OPTION_SEPARATOR_OUTPUT = 'output_separator' |
Protected Member Functions | |
| buildQuery (array $data, $separator, $key=null) | |
| parseUrl ($url) | |
Private Member Functions | |
| _queryArrayByKey ($key, $value, array $array=array()) | |
| _queryArrayByBrackets ($buffer, $value, array $array=null) | |
| _queryKeyBracketOffset ($key) | |
| _buildAuthorityAndPath ($authority, $path) | |
| _normalize ($mixed) | |
| _normalizeCallback ($matches) | |
| _isFragmentOnly () | |
| _encodeData ($url) | |
| _encodeCallback (array $matches) | |
Private Attributes | |
| $_options | |
| $_scheme = false | |
| $_userinfo = false | |
| $_host = false | |
| $_port = false | |
| $_path = '' | |
| $_query = false | |
| $_fragment = false | |
| __construct | ( | $url, | |
| array | $options = array() |
||
| ) |
Constructor.
| string | $url | an absolute or relative URL |
| array | $options | an array of OPTION_xxx constants |
self::parseUrl()
Definition at line 148 of file URL2.php.
References $url, and parseUrl().
| __get | ( | $var | ) |
Magic Getter.
This is the magic get method to retrieve the private variable that was set by either __set() or it's setter...
| string | $var | The property name to retrieve. |
| __set | ( | $var, | |
| $arg | |||
| ) |
| __toString | ( | ) |
Returns a string representation of this URL.
Definition at line 752 of file URL2.php.
References getURL().
Referenced by HTTP_Request2\send().
|
private |
|
private |
callback for encoding character data
| array | $matches | Matches |
|
private |
Encode characters that might have been forgotten to encode when passing in an URL. Applied onto Userinfo, Path and Query.
| string | $url | URL |
Definition at line 1198 of file URL2.php.
References $url.
Referenced by parseUrl(), setAuthority(), and setUserinfo().
|
private |
|
private |
Normalize case of XX percentage-encodings (RFC 3986, section 6.2.2.1) Normalize percentage-encoded unreserved characters (section 6.2.2.2)
| string | array | $mixed | string or array of strings to normalize |
Definition at line 840 of file URL2.php.
Referenced by normalize().
|
private |
Callback for _normalize() of XX percentage-encodings
| array | $matches | as by preg_replace_callback |
|
private |
Parse a key-buffer to place value in array
| string | $buffer | to consume all keys from |
| string | $value | to be set/add |
| array | $array | to traverse and set/add value in |
| Exception |
Definition at line 572 of file URL2.php.
References _queryKeyBracketOffset().
Referenced by _queryArrayByKey().
|
private |
Parse a single query key=value pair into an existing php array
| string | $key | query-key |
| string | $value | query-value |
| array | $array | of existing query variables (if any) |
Definition at line 528 of file URL2.php.
References _queryArrayByBrackets(), and _queryKeyBracketOffset().
Referenced by getQueryVariables().
|
private |
Query-key has brackets ("...[]")
| string | $key | query-key |
Definition at line 633 of file URL2.php.
Referenced by _queryArrayByBrackets(), and _queryArrayByKey().
|
protected |
A simple version of http_build_query in userland. The encoded string is percentage encoded according to RFC 3986.
| array | $data | An array, which has to be converted into QUERY_STRING. Anything is possible. |
| string | $separator | Separator self::OPTION_SEPARATOR_OUTPUT |
| string | $key | For stacked values (arrays in an array). |
Definition at line 1128 of file URL2.php.
References getOption().
Referenced by setQueryVariables().
| getAuthority | ( | ) |
|
static |
| getFragment | ( | ) |
Returns the fragment name, or false if "#" is not present in the URL.
Definition at line 459 of file URL2.php.
References $_fragment.
| getHost | ( | ) |
Returns the host part, or false if there is no authority part, e.g. relative URLs.
Definition at line 296 of file URL2.php.
References $_host.
Referenced by HTTP_Request2_CookieJar\getMatching().
| getNormalizedURL | ( | ) |
| getOption | ( | $optionName | ) |
Returns the value of the specified option.
| string | $optionName | The name of the option to retrieve |
Definition at line 1111 of file URL2.php.
Referenced by buildQuery(), getQueryVariables(), resolve(), and setQueryVariables().
| getPassword | ( | ) |
| getPath | ( | ) |
Returns the path part (possibly an empty string).
Definition at line 409 of file URL2.php.
References $_path.
Referenced by HTTP_Request2_CookieJar\getMatching().
| getPort | ( | ) |
| getQuery | ( | ) |
Returns the query string (excluding the leading "?"), or false if "?" is not present in the URL.
Definition at line 434 of file URL2.php.
References $_query.
| getQueryVariables | ( | ) |
Returns the query string like an array as the variables would appear in $_GET in a PHP script. If the URL does not contain a "?", an empty array is returned.
Definition at line 485 of file URL2.php.
References _queryArrayByKey(), and getOption().
Referenced by setQueryVariable(), and unsetQueryVariable().
|
static |
|
static |
| getScheme | ( | ) |
Returns the scheme, e.g. "http" or "urn", or false if there is no scheme specified, i.e. if this is a relative URL.
Definition at line 206 of file URL2.php.
References $_scheme.
Referenced by HTTP_Request2_CookieJar\getMatching().
| getURL | ( | ) |
Returns a string representation of this URL.
Definition at line 699 of file URL2.php.
References $_fragment, $_query, $url, _buildAuthorityAndPath(), and getAuthority().
Referenced by __toString().
| getUser | ( | ) |
| getUserinfo | ( | ) |
Returns the userinfo part, or false if there is none, i.e. if the authority part does not contain "@".
Definition at line 262 of file URL2.php.
References $_userinfo.
| isAbsolute | ( | ) |
Returns whether this instance represents an absolute URL.
Definition at line 868 of file URL2.php.
References $_scheme.
Referenced by resolve(), and HTTP_Request2\send().
| normalize | ( | ) |
Normalizes the URL
See RFC 3986, Section 6. Normalization and Comparison
Definition at line 779 of file URL2.php.
References $_path, _normalize(), and getAuthority().
|
protected |
This method uses a regex to parse the url into the designated parts.
| string | $url | URL |
Definition at line 1166 of file URL2.php.
References $url, _encodeData(), and setAuthority().
Referenced by __construct().
|
static |
| resolve | ( | $reference | ) |
Returns an Net_URL2 instance representing an absolute URL relative to this URL.
| Net_URL2 | string | $reference | relative URL |
| Exception |
Definition at line 882 of file URL2.php.
References $_path, $_query, $_scheme, getAuthority(), getOption(), and isAbsolute().
Referenced by HTTP_Request2_Adapter_Curl\callbackWriteHeader().
| setAuthority | ( | $authority | ) |
Sets the authority part, i.e. [ userinfo "@" ] host [ ":" port ]. Specify false if there is no authority.
| string | bool | $authority | a hostname or an IP address, possibly with userinfo prefixed and port number appended, e.g. "foo:bar@example.org:81". |
Definition at line 377 of file URL2.php.
References _encodeData().
Referenced by parseUrl().
| setFragment | ( | $fragment | ) |
| setHost | ( | $host | ) |
| setPath | ( | $path | ) |
| setPort | ( | $port | ) |
| setQuery | ( | $query | ) |
Sets the query string (excluding the leading "?"). Specify false if "?" is not present in the URL.
| string | bool | $query | a query string, e.g. "foo=1&bar=2" |
| setQueryVariable | ( | $name, | |
| $value | |||
| ) |
Sets the specified variable in the query string.
| string | $name | variable name |
| mixed | $value | variable value |
Definition at line 672 of file URL2.php.
References getQueryVariables(), and setQueryVariables().
| setQueryVariables | ( | array | $array | ) |
Sets the query string to the specified variable in the query string.
| array | $array | (name => value) array |
Definition at line 651 of file URL2.php.
References buildQuery(), and getOption().
Referenced by setQueryVariable(), and unsetQueryVariable().
| setScheme | ( | $scheme | ) |
Sets the scheme, e.g. "http" or "urn". Specify false if there is no scheme specified, i.e. if this is a relative URL.
| string | bool | $scheme | e.g. "http" or "urn", or false if there is no scheme specified, i.e. if this is a relative URL |
| setUserinfo | ( | $userinfo, | |
$password = false |
|||
| ) |
Sets the userinfo part. If two arguments are passed, they are combined in the userinfo part as username ":" password.
| string | bool | $userinfo | userinfo or username |
| string | bool | $password | optional password, or false |
Definition at line 276 of file URL2.php.
References _encodeData().
| unsetQueryVariable | ( | $name | ) |
Removes the specified variable from the query string.
| string | $name | a query string variable, e.g. "foo" in "?foo=1" |
Definition at line 687 of file URL2.php.
References getQueryVariables(), and setQueryVariables().
|
static |
|
private |
Definition at line 138 of file URL2.php.
Referenced by getFragment(), and getURL().
|
private |
Definition at line 118 of file URL2.php.
Referenced by getAuthority(), and getHost().
|
private |
Default options corresponds to how PHP handles $_GET.
|
private |
Definition at line 128 of file URL2.php.
Referenced by getPath(), normalize(), and resolve().
|
private |
Definition at line 123 of file URL2.php.
Referenced by getAuthority(), and getPort().
|
private |
Definition at line 133 of file URL2.php.
Referenced by getQuery(), getURL(), and resolve().
|
private |
Definition at line 108 of file URL2.php.
Referenced by getScheme(), isAbsolute(), and resolve().
|
private |
Definition at line 113 of file URL2.php.
Referenced by getUserinfo().
| const OPTION_DROP_SEQUENCE = 'drop_sequence' |
| const OPTION_ENCODE_KEYS = 'encode_keys' |
| const OPTION_SEPARATOR_INPUT = 'input_separator' |
| const OPTION_SEPARATOR_OUTPUT = 'output_separator' |
| const OPTION_STRICT = 'strict' |
| const OPTION_USE_BRACKETS = 'use_brackets' |
Represent arrays in query using PHP's [] notation. Default is true.
Definition at line 68 of file URL2.php.
Referenced by HTTP_Request2_Adapter_Socket\handleRedirect(), and HTTP_Request2\setUrl().
1.8.3