\Zend_Uri_Http
HTTP(S) URI handler
- Copyright: Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
- License: http://framework.zend.com/license/new-bsd New BSD License
Synopsis
class Zend_Uri_Http
extends Zend_Uri
{
- // constants
- const CHAR_ALNUM = 'A-Za-z0-9';
- const CHAR_MARK = '-_.!~*\'()\[\]';
- const CHAR_RESERVED = ';\/?:@&=+$,';
- const CHAR_SEGMENT = ':@&=+$,;';
- const CHAR_UNWISE = '{}|\\\\^`';
- // members
- protected string $_username = '';
- protected string $_password = '';
- protected string $_host = '';
- protected string $_port = '';
- protected string $_path = '';
- protected string $_query = '';
- protected string $_fragment = '';
- protected array $_regex = ;
- // methods
- protected void __construct()
- public static Zend_Uri_Http fromString()
- protected void _parseUri()
- public string getUri()
- public boolean valid()
- public string getUsername()
- public boolean validateUsername()
- public string setUsername()
- public string getPassword()
- public boolean validatePassword()
- public string setPassword()
- public string getHost()
- public boolean validateHost()
- public string setHost()
- public string getPort()
- public boolean validatePort()
- public string setPort()
- public string getPath()
- public boolean validatePath()
- public string setPath()
- public string getQuery()
- public boolean validateQuery()
- public string setQuery()
- public string|false getFragment()
- public boolean validateFragment()
- public string setFragment()
- // Inherited methods from Zend_Uri
- public string __toString()
- public static boolean check()
- public static Zend_Uri factory()
- public string|false getScheme()
- public static void setConfig()
- protected abstract void __construct()
- public abstract string getUri()
- public abstract boolean valid()
Hierarchy
Extends
Constants
Name | Value |
---|---|
CHAR_ALNUM | 'A-Za-z0-9' |
CHAR_MARK | '-_.!~*\'()\[\]' |
CHAR_RESERVED | ';\/?:@&=+$,' |
CHAR_SEGMENT | ':@&=+$,;' |
CHAR_UNWISE | '{}|\\\\^`' |
Members
protected
- $_config
—
array
Global configuration array - $_fragment
—
string
HTTP fragment - $_host
—
string
HTTP host - $_password
—
string
HTTP password - $_path
—
string
HTTP part - $_port
—
string
HTTP post - $_query
—
string
HTTP query - $_regex
—
array
Regular expression grammar rules for validation; values added by constructor - $_scheme
—
string
Scheme of this URI (http, ftp, etc.) - $_username
—
string
HTTP username
Methods
protected
- __construct() — 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)
- _parseUri() — Parse the scheme-specific portion of the URI and place its parts into instance variables.
public
- fromString() — Creates a Zend_Uri_Http from the given string
- getFragment() — Returns the fragment portion of the URL (after #), or FALSE if none.
- getHost() — Returns the domain or host IP portion of the URL, or FALSE if none.
- getPassword() — Returns the password portion of the URL, or FALSE if none.
- getPath() — Returns the path and filename portion of the URL, or FALSE if none.
- getPort() — Returns the TCP port, or FALSE if none.
- getQuery() — Returns the query portion of the URL (after ?), or FALSE if none.
- getUri() — 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.
- getUsername() — Returns the username portion of the URL, or FALSE if none.
- setFragment() — Sets the fragment for the current URI, and returns the old fragment
- setHost() — Sets the host for the current URI, and returns the old host
- setPassword() — Sets the password for the current URI, and returns the old password
- setPath() — Sets the path for the current URI, and returns the old path
- setPort() — Sets the port for the current URI, and returns the old port
- setQuery() — Set the query string for the current URI, and return the old query string This method accepts both strings and arrays.
- setUsername() — Sets the username for the current URI, and returns the old username
- valid() — Validate the current URI from the instance variables. Returns true if and only if all parts pass validation.
- validateFragment() — 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.
- validateHost() — 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.
- validatePassword() — 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.
- validatePath() — 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.
- validatePort() — 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.
- validateQuery() — 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.
- validateUsername() — 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.
Inherited from Zend_Uri
public
- __toString() — Return a string representation of this URI.
- check() — Convenience function, checks that a $uri string is well-formed by validating it but not returning an object. Returns TRUE if $uri is a well-formed URI, or FALSE otherwise.
- factory() — Create a new Zend_Uri object for a URI. If building a new URI, then $uri should contain only the scheme (http, ftp, etc). Otherwise, supply $uri with the complete URI.
- getScheme() — Get the URI's scheme
- getUri() — Return a string representation of this URI.
- setConfig() — Set global configuration options
- valid() — Returns TRUE if this URI is valid, or FALSE otherwise.