Authentication: ezcAuthenticationUrl
[ ]
[ Rfcs ] [ Security ]
[ ]
[ ]
[ ]
[ ]
Class: ezcAuthenticationUrl
|
Class which provides a methods for handling URLs. [
source]
Method Summary
|
public static string |
appendQuery(
$url, $key, $value )
Appends a query value to the provided URL and returns the complete URL. |
|
public static string |
buildUrl(
$parts )
Creates a string URL from the provided $parts array. |
|
public static true |
fetchQuery(
$url, $key )
Fetches the value of key $key from the query of the provided URL. |
|
public static string |
normalize(
$url )
Normalizes the provided URL. |
|
public static array(string=>mixed) |
parseQueryString(
$str )
Parses the provided string and returns an associative array structure. |
Methods
appendQuery
string appendQuery(
string
$url, string
$key, string
$value )
Appends a query value to the provided URL and returns the complete URL.
Parameters
| Name |
Type |
Description |
$url |
string |
The URL to append a query value to |
$key |
string |
The query key to append to the URL |
$value |
string |
The query value to append to the URL |
buildUrl
string buildUrl(
$parts )
Creates a string URL from the provided $parts array.
The format of the $parts array is similar to the one returned by parse_url(), with the 'query' part as an array(key=>value) (obtained with the function parse_str()).
Parameters
| Name |
Type |
Description |
$parts |
array(string=>mixed) |
The parts of the URL |
fetchQuery
true fetchQuery(
string
$url, string
$key )
Fetches the value of key $key from the query of the provided URL.
Parameters
| Name |
Type |
Description |
$url |
string |
The URL from which to fetch the query value |
$key |
string |
The query key for which to get the value |
normalize
string normalize(
string
$url )
Normalizes the provided URL.
The operations performed on the provided URL:
- trim
- add 'http://' in front if it is missing
Parameters
| Name |
Type |
Description |
$url |
string |
The URL to normalize |
parseQueryString
array(string=>mixed) parseQueryString(
array(string=>mixed)
$str )
Parses the provided string and returns an associative array structure.
It implements the functionality of the PHP function parse_str(), but without converting dots to underscores in parameter names.
Example:
1. $str = 'foo[]=bar&openid.nonce=123456';
2.
3. parse_str( $str, $params );
4. $params = ezcUrlTools::parseQuery( $str );
In the first case (parse_str()), $params will be:
1. array( 'foo' => array( 'bar' ), 'openid_nonce' => '123456' );
In the second case (ezcUrlTools::parseQueryString()), $params will be:
1. array( 'foo' => array( 'bar' ), 'openid.nonce' => '123456' );
The same function is defined in
ezcUrlTools in the Url component.
Parameters
| Name |
Type |
Description |
$str |
array(string=>mixed) |
The string to parse |
Last updated: Mon, 12 Nov 2007