ILIAS
Release_4_0_x_branch Revision 61816
|
Public Member Functions | |
Net_URL ($url=null, $useBrackets=true) | |
PHP4 Constructor. | |
__construct ($url=null, $useBrackets=true) | |
PHP5 Constructor. | |
initialize () | |
getURL () | |
Returns full url. | |
addQueryString ($name, $value, $preencoded=false) | |
Adds or updates a querystring item (URL parameter). | |
removeQueryString ($name) | |
Removes a querystring item. | |
addRawQueryString ($querystring) | |
Sets the querystring to literally what you supply. | |
getQueryString () | |
Returns flat querystring. | |
_parseRawQuerystring ($querystring) | |
Parses raw querystring and returns an array of it. | |
resolvePath ($path) | |
Resolves //, ../ and . | |
getStandardPort ($scheme) | |
Returns the standard port number for a protocol. | |
setProtocol ($protocol, $port=null) | |
Forces the URL to a particular protocol. | |
setOption ($optionName, $value) | |
Set an option. | |
getOption ($optionName) | |
Get an option. |
Data Fields | |
$options = array('encode_query_keys' => false) | |
$url | |
$protocol | |
$username | |
$password | |
$host | |
$port | |
$path | |
$querystring | |
$anchor | |
$useBrackets |
Net_URL::__construct | ( | $url = null , |
|
$useBrackets = true |
|||
) |
PHP5 Constructor.
Parses the given url and stores the various parts Defaults are used in certain cases
string | $url | Optional URL |
bool | $useBrackets | Whether to use square brackets when multiple querystrings with the same name exist |
Definition at line 124 of file URL.php.
References $url, $useBrackets, and initialize().
Referenced by Net_URL().
Net_URL::_parseRawQuerystring | ( | $querystring | ) |
Parses raw querystring and returns an array of it.
string | $querystring | The querystring to parse |
Definition at line 324 of file URL.php.
References $key, $querystring, elseif(), and getOption().
Referenced by initialize().
Net_URL::addQueryString | ( | $name, | |
$value, | |||
$preencoded = false |
|||
) |
Adds or updates a querystring item (URL parameter).
Automatically encodes parameters with rawurlencode() if $preencoded is false. You can pass an array to $value, it gets mapped via [] in the URL if $this->useBrackets is activated.
string | $name | Name of item |
string | $value | Value of item |
bool | $preencoded | Whether value is urlencoded or not, default = not public |
Definition at line 245 of file URL.php.
References $name, and getOption().
Net_URL::addRawQueryString | ( | $querystring | ) |
Sets the querystring to literally what you supply.
string | $querystring | The querystring data. Should be of the format foo=bar&x=y etc public |
Definition at line 281 of file URL.php.
References $querystring.
Net_URL::getOption | ( | $optionName | ) |
Get an option.
This function gets an option from the $this->options array and return it's value.
public
string | $opionName | The name of the option to retrieve |
Definition at line 475 of file URL.php.
Referenced by _parseRawQuerystring(), addQueryString(), and removeQueryString().
Net_URL::getQueryString | ( | ) |
Returns flat querystring.
Definition at line 292 of file URL.php.
References $name, $querystring, and elseif().
Referenced by getURL().
Net_URL::getStandardPort | ( | $scheme | ) |
Returns the standard port number for a protocol.
string | $scheme | The protocol to lookup |
Definition at line 418 of file URL.php.
Referenced by getURL(), initialize(), and setProtocol().
Net_URL::getURL | ( | ) |
Returns full url.
Definition at line 218 of file URL.php.
References $port, $querystring, $url, getQueryString(), and getStandardPort().
Net_URL::initialize | ( | ) |
Figure out host/port
Definition at line 132 of file URL.php.
References $GLOBALS, $host, $key, $path, $port, _parseRawQuerystring(), and getStandardPort().
Referenced by __construct(), and setOption().
Net_URL::Net_URL | ( | $url = null , |
|
$useBrackets = true |
|||
) |
PHP4 Constructor.
Definition at line 108 of file URL.php.
References $url, $useBrackets, and __construct().
Net_URL::removeQueryString | ( | $name | ) |
Removes a querystring item.
string | $name | Name of item public |
Definition at line 264 of file URL.php.
References $name, and getOption().
Net_URL::resolvePath | ( | $path | ) |
Resolves //, ../ and .
/ from a path and returns the result. Eg:
/foo/bar/../boo.php => /foo/boo.php /foo/bar/../../boo.php => /boo.php /foo/bar/.././/boo.php => /foo/boo.php
This method can also be called statically.
string | $path | URL path to resolve |
Definition at line 381 of file URL.php.
References $path, and elseif().
Net_URL::setOption | ( | $optionName, | |
$value | |||
) |
Set an option.
This function set an option to be used thorough the script.
public
string | $optionName | The optionname to set |
string | $value | The value of this option. |
Definition at line 454 of file URL.php.
References initialize().
Net_URL::setProtocol | ( | $protocol, | |
$port = null |
|||
) |
Forces the URL to a particular protocol.
string | $protocol | Protocol to force the URL to |
integer | $port | Optional port (standard port is used by default) |
Definition at line 438 of file URL.php.
References $port, $protocol, and getStandardPort().
Net_URL::$host |
Definition at line 71 of file URL.php.
Referenced by initialize().
Net_URL::$path |
Definition at line 83 of file URL.php.
Referenced by initialize(), and resolvePath().
Net_URL::$port |
Definition at line 77 of file URL.php.
Referenced by getURL(), initialize(), and setProtocol().
Net_URL::$protocol |
Definition at line 53 of file URL.php.
Referenced by setProtocol().
Net_URL::$querystring |
Definition at line 89 of file URL.php.
Referenced by _parseRawQuerystring(), addRawQueryString(), getQueryString(), and getURL().
Net_URL::$url |
Definition at line 47 of file URL.php.
Referenced by __construct(), getURL(), and Net_URL().
Net_URL::$useBrackets |
Definition at line 101 of file URL.php.
Referenced by __construct(), and Net_URL().