Package: erfurt

Class Net_URL





Description
Variable Summary
string $anchor
string $host
string $password
string $path
integer $port
string $protocol
array $querystring
string $url
bool $useBrackets
string $username
Method Summary
Net_URL __construct ([string $url = null] , [bool $useBrackets = true] )
Net_URL Net_URL ([ $url = null] , [ $useBrackets = true] )
void addQueryString (string $name, string $value, [bool $preencoded = false] )
void addRawQueryString (string $querystring)
string getQueryString ()
integer getStandardPort (string $scheme)
string getURL ()
void removeQueryString (string $name)
string resolvePath ( $path, string $url)
void setProtocol (string $protocol, [integer $port = null] )
Variables
$anchor
string $anchor

Anchor

$host
string $host

Host

$password
string $password

Password

$path
string $path

Path

$port
integer $port

Port

$protocol
string $protocol

Protocol

$querystring
array $querystring

Query string

$url
string $url

Full url

$useBrackets
bool $useBrackets

Whether to use []

$username
string $username

Username

Methods
Constructor __construct
Net_URL __construct ( [ string $url = null ] , [ bool $useBrackets = true ] )

PHP5 Constructor Parses the given url and stores the various parts Defaults are used in certain cases

Parameters:
  • string $url : Optional URL
  • bool $useBrackets : Whether to use square brackets when multiple querystrings with the same name exist
Constructor Net_URL
Net_URL Net_URL ( [ $url = null ] , [ $useBrackets = true ] )

PHP4 Constructor

Parameters:
  • $url
  • $useBrackets
addQueryString
void addQueryString ( string $name , string $value , [ bool $preencoded = false ] )

Adds a querystring item

  • access: public
Parameters:
  • string $name : Name of item
  • string $value : Value of item
  • bool $preencoded : Whether value is urlencoded or not, default = not
addRawQueryString
void addRawQueryString ( string $querystring )

Sets the querystring to literally what you supply

  • access: public
Parameters:
  • string $querystring : The querystring data. Should be of the format foo=bar&x=y etc
getQueryString
string getQueryString ()

Returns flat querystring

  • return: Querystring
  • access: public
getStandardPort
integer getStandardPort ( string $scheme )

Returns the standard port number for a protocol

Parameters:
  • string $scheme : The protocol to lookup
getURL
string getURL ()

Returns full url

  • return: Full url
  • access: public
removeQueryString
void removeQueryString ( string $name )

Removes a querystring item

  • access: public
Parameters:
  • string $name : Name of item
resolvePath
string resolvePath ( $path , string $url )

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.

  • return: The result
Parameters:
  • string $url : URL path to resolve
  • $path
setProtocol
void setProtocol ( string $protocol , [ integer $port = null ] )

Forces the URL to a particular protocol

Parameters:
  • string $protocol : Protocol to force the URL to
  • integer $port : Optional port (standard port is used by default)

Documentation generated on 2009-01-06 at 01:01 by phpDocumentor 1.4.1