## Zend_Uri_Http

Description

HTTP(S) URI handler

- copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
- license: New BSD License
- uses: Zend_Uri

Located in /Uri/Http.php (line 41)

    Zend_Uri
       |
       --Zend_Uri_Http

Class Constant Summary
CHAR_ALNUM = 'A-Za-z0-9'
CHAR_MARK = '-_.!~*\'()\[\]'
CHAR_RESERVED = ';\/?:@&=+$,'
CHAR_SEGMENT = ':@&=+$,;'
CHAR_UNWISE = '{}|\\\\^`'
Variable Summary
string $_fragment
string $_host
string $_password
string $_path
string $_port
string $_query
array $_regex
string $_username
Method Summary
static Zend_Uri_Http fromString (string $uri)
Zend_Uri_Http __construct (string $scheme, [string $schemeSpecific = ''])
string addReplaceQueryParameters ( $queryParams)
string|false getFragment ()
string getHost ()
string getPassword ()
string getPath ()
string getPort ()
string getQuery ()
array getQueryAsArray ()
string getUri ()
string getUsername ()
string removeQueryParameters ( $queryParamKeys)
string setFragment (string $fragment)
string setHost (string $host)
string setPassword (string $password)
string setPath (string $path)
string setPort (string $port)
string setQuery (string|array $query)
string setUsername (string $username)
boolean valid ()
boolean validateFragment ([string $fragment = null])
boolean validateHost ([string $host = null])
boolean validatePassword ([string $password = null])
boolean validatePath ([string $path = null])
boolean validatePort ([string $port = null])
boolean validateQuery ([string $query = null])
boolean validateUsername ([string $username = null])
void _parseUri (string $schemeSpecific)
Variables
string $_fragment = '' (line 99)

HTTP fragment

- access: protected

string $_host = '' (line 71)

HTTP host

- access: protected

string $_password = '' (line 64)

HTTP password

- access: protected

string $_path = '' (line 85)

HTTP part

- access: protected

string $_port = '' (line 78)

HTTP post

- access: protected

string $_query = '' (line 92)

HTTP query

- access: protected

array $_regex = array() (line 106)

Regular expression grammar rules for validation; values added by constructor

- access: protected

string $_username = '' (line 57)

HTTP username

- access: protected

#### Inherited Variables

Inherited from Zend_Uri

> Zend_Uri::$_config
> Zend_Uri::$_scheme

Methods
static fromString (line 170)

Creates a Zend_Uri_Http from the given string

- throws: InvalidArgumentException When the given $uri is not a string or does not start with http:// or https://
- throws: Zend_Uri_Exception When the given $uri is invalid
- access: public

static Zend_Uri_Http fromString (string $uri)

- string $uri: String to create URI from, must start with 'http://' or 'https://'

Constructor __construct (line 116)

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)

- throws: Zend_Uri_Exception When the URI is not valid
- access: protected

Zend_Uri_Http __construct (string $scheme, [string $schemeSpecific = ''])

- string $scheme: The scheme of the URI
- string $schemeSpecific: The scheme-specific part of the URI

Redefinition of:

Zend_Uri::__construct()
  Zend_Uri and its subclasses cannot be instantiated directly.

addReplaceQueryParameters (line 649)

Add or replace params in the query string for the current URI, and return the old query.

- return: Old query string
- access: public

string addReplaceQueryParameters ( $queryParams)

- array $queryParams

getFragment (line 714)

Returns the fragment portion of the URL (after #), or FALSE if none.

- access: public

string|false getFragment ()
getHost (line 422)

Returns the domain or host IP portion of the URL, or FALSE if none.

- access: public

string getHost ()
getPassword (line 355)

Returns the password portion of the URL, or FALSE if none.

- access: public

string getPassword ()
getPath (line 529)

Returns the path and filename portion of the URL, or FALSE if none.

- access: public

string getPath ()
getPort (line 477)

Returns the TCP port, or FALSE if none.

- access: public

string getPort ()
getQuery (line 589)

Returns the query portion of the URL (after ?), or FALSE if none.

- access: public

string getQuery ()
getQueryAsArray (line 601)

Returns the query portion of the URL (after ?) as a key-value-array. If the query is empty an empty array is returned

- access: public

array getQueryAsArray ()
getUri (line 247)

Returns 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.

- throws: Zend_Uri_Exception When one or more parts of the URI are invalid
- access: public

string getUri ()

Redefinition of:

Zend_Uri::getUri()
  Return a string representation of this URI.

getUsername (line 293)

Returns the username portion of the URL, or FALSE if none.

- access: public

string getUsername ()
removeQueryParameters (line 662)

Remove params in the query string for the current URI, and return the old query.

- return: Old query string
- access: public

string removeQueryParameters ( $queryParamKeys)

- array $queryParamKeys

setFragment (line 757)

Sets the fragment for the current URI, and returns the old fragment

- throws: Zend_Uri_Exception When $fragment is not a valid HTTP fragment
- access: public

string setFragment (string $fragment)

- string $fragment: Fragment of the current URI

setHost (line 459)

Sets the host for the current URI, and returns the old host

- throws: Zend_Uri_Exception When $host is nota valid HTTP host
- access: public

string setHost (string $host)

- string $host: The HTTP host

setPassword (line 404)

Sets the password for the current URI, and returns the old password

- throws: Zend_Uri_Exception When $password is not a valid HTTP password
- access: public

string setPassword (string $password)

- string $password: The HTTP password

setPath (line 571)

Sets the path for the current URI, and returns the old path

- throws: Zend_Uri_Exception When $path is not a valid HTTP path
- access: public

string setPath (string $path)

- string $path: The HTTP path

setPort (line 511)

Sets the port for the current URI, and returns the old port

- throws: Zend_Uri_Exception When $port is not a valid HTTP port
- access: public

string setPort (string $port)

- string $port: The HTTP port

setQuery (line 676)

Set the query string for the current URI, and return the old query string This method accepts both strings and arrays.

- return: Old query string
- throws: Zend_Uri_Exception When $query is not a valid query string
- access: public

string setQuery (string|array $query)

- string|array $query: The query string or array

setUsername (line 337)

Sets the username for the current URI, and returns the old username

- throws: Zend_Uri_Exception When $username is not a valid HTTP username
- access: public

string setUsername (string $username)

- string $username: The HTTP username

valid (line 276)

Validate the current URI from the instance variables. Returns true if and only if all parts pass validation.

- access: public

boolean valid ()

Redefinition of:

Zend_Uri::valid()
  Returns TRUE if this URI is valid, or FALSE otherwise.

validateFragment (line 728)

Returns true if and only if the fragment passes validation. If no fragment is passed, then the fragment contained in the instance variable is used.

- link: http://www.faqs.org/rfcs/rfc2396.html
- throws: Zend_Uri_Exception When fragment validation fails
- access: public

boolean validateFragment ([string $fragment = null])

- string $fragment: Fragment of an URI

validateHost (line 435)

Returns 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.

- access: public
- uses: Zend_Filter

boolean validateHost ([string $host = null])

- string $host: The HTTP host

validatePassword (line 369)

Returns true if and only if the password passes validation. If no password is passed, then the password contained in the instance variable is used.

- link: http://www.faqs.org/rfcs/rfc2396.html
- throws: Zend_Uri_Exception When password validation fails
- access: public

boolean validatePassword ([string $password = null])

- string $password: The HTTP password

validatePath (line 542)

Returns 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.

- throws: Zend_Uri_Exception When path validation fails
- access: public

boolean validatePath ([string $path = null])

- string $path: The HTTP path

validatePort (line 489)

Returns 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.

- access: public

boolean validatePort ([string $port = null])

- string $port: The HTTP port

validateQuery (line 620)

Returns 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.

- link: http://www.faqs.org/rfcs/rfc2396.html
- throws: Zend_Uri_Exception When query validation fails
- access: public

boolean validateQuery ([string $query = null])

- string $query: The query to validate

validateUsername (line 307)

Returns true if and only if the username passes validation. If no username is passed, then the username contained in the instance variable is used.

- link: http://www.faqs.org/rfcs/rfc2396.html
- throws: Zend_Uri_Exception When username validation fails
- access: public

boolean validateUsername ([string $username = null])

- string $username: The HTTP username

_parseUri (line 198)

Parse the scheme-specific portion of the URI and place its parts into instance variables.

- throws: Zend_Uri_Exception When authority decomposition fails
- throws: Zend_Uri_Exception When scheme-specific decoposition fails
- access: protected

void _parseUri (string $schemeSpecific)

- string $schemeSpecific: The scheme-specific portion to parse

#### Inherited Methods

Inherited From Zend_Uri

> Zend_Uri::__construct()
> Zend_Uri::check()
> Zend_Uri::factory()
> Zend_Uri::getScheme()
> Zend_Uri::getUri()
> Zend_Uri::setConfig()
> Zend_Uri::valid()
> Zend_Uri::__toString()

Class Constants
CHAR_ALNUM = 'A-Za-z0-9' (line 46)

Character classes for validation regular expressions

CHAR_MARK = '-_.!~*\'()\[\]' (line 47)
CHAR_RESERVED = ';\/?:@&=+$,' (line 48)
CHAR_SEGMENT = ':@&=+$,;' (line 49)
CHAR_UNWISE = '{}|\\\\^`' (line 50)

Documentation generated on Tue, 26 Oct 2010 20:08:49 +0400 by phpDocumentor 1.4.2