Microsoft_Uri
[ class tree: Microsoft_Uri ] [ index: Microsoft_Uri ] [ all elements ]

Class: Microsoft_Uri_Http

Source Location: /Uri/Http.php

Class Overview

Microsoft_Uri
   |
   --Microsoft_Uri_Http

HTTP(S) URI handler


Author(s):

Copyright:

  • Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)

Variables

Constants

Methods


Inherited Variables

Inherited Methods

Class: Microsoft_Uri

Microsoft_Uri::__construct()
Microsoft_Uri and its subclasses cannot be instantiated directly.
Microsoft_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.
Microsoft_Uri::factory()
Create a new Microsoft_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.
Microsoft_Uri::getScheme()
Get the URI's scheme
Microsoft_Uri::getUri()
Return a string representation of this URI.
Microsoft_Uri::setConfig()
Set global configuration options
Microsoft_Uri::valid()
Returns TRUE if this URI is valid, or FALSE otherwise.
Microsoft_Uri::__toString()
Return a string representation of this URI.

Class Details

[line 36]
HTTP(S) URI handler



Tags:

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


[ Top ]


Class Variables

$_fragment =  ''

[line 94]

HTTP fragment



Tags:

access:  protected

Type:   string


[ Top ]

$_host =  ''

[line 66]

HTTP host



Tags:

access:  protected

Type:   string


[ Top ]

$_password =  ''

[line 59]

HTTP password



Tags:

access:  protected

Type:   string


[ Top ]

$_path =  ''

[line 80]

HTTP part



Tags:

access:  protected

Type:   string


[ Top ]

$_port =  ''

[line 73]

HTTP post



Tags:

access:  protected

Type:   string


[ Top ]

$_query =  ''

[line 87]

HTTP query



Tags:

access:  protected

Type:   string


[ Top ]

$_regex = array()

[line 101]

Regular expression grammar rules for validation; values added by constructor



Tags:

access:  protected

Type:   array


[ Top ]

$_username =  ''

[line 52]

HTTP username



Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


static method fromString [line 165]

static Microsoft_Uri_Http fromString( string $uri)

Creates a Microsoft_Uri_Http from the given string



Tags:

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


Parameters:

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

[ Top ]

constructor __construct [line 111]

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

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)



Tags:

throws:  Microsoft_Uri_Exception When the URI is not valid
access:  protected


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

Parameters:

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

[ Top ]

method addReplaceQueryParameters [line 641]

string addReplaceQueryParameters( $queryParams)

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



Tags:

return:  Old query string
access:  public


Parameters:

array   $queryParams  

[ Top ]

method getFragment [line 706]

string|false getFragment( )

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



Tags:

access:  public


[ Top ]

method getHost [line 417]

string getHost( )

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



Tags:

access:  public


[ Top ]

method getPassword [line 350]

string getPassword( )

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



Tags:

access:  public


[ Top ]

method getPath [line 521]

string getPath( )

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



Tags:

access:  public


[ Top ]

method getPort [line 469]

string getPort( )

Returns the TCP port, or FALSE if none.



Tags:

access:  public


[ Top ]

method getQuery [line 581]

string getQuery( )

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



Tags:

access:  public


[ Top ]

method getQueryAsArray [line 593]

array getQueryAsArray( )

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



Tags:

access:  public


[ Top ]

method getUri [line 242]

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



Tags:

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


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

[ Top ]

method getUsername [line 288]

string getUsername( )

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



Tags:

access:  public


[ Top ]

method removeQueryParameters [line 654]

string removeQueryParameters( $queryParamKeys)

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



Tags:

return:  Old query string
access:  public


Parameters:

array   $queryParamKeys  

[ Top ]

method setFragment [line 749]

string setFragment( string $fragment)

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



Tags:

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


Parameters:

string   $fragment   Fragment of the current URI

[ Top ]

method setHost [line 451]

string setHost( string $host)

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



Tags:

throws:  Microsoft_Uri_Exception When $host is nota valid HTTP host
access:  public


Parameters:

string   $host   The HTTP host

[ Top ]

method setPassword [line 399]

string setPassword( string $password)

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



Tags:

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


Parameters:

string   $password   The HTTP password

[ Top ]

method setPath [line 563]

string setPath( string $path)

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



Tags:

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


Parameters:

string   $path   The HTTP path

[ Top ]

method setPort [line 503]

string setPort( string $port)

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



Tags:

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


Parameters:

string   $port   The HTTP port

[ Top ]

method setQuery [line 668]

string setQuery( string|array $query)

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



Tags:

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


Parameters:

string|array   $query   The query string or array

[ Top ]

method setUsername [line 332]

string setUsername( string $username)

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



Tags:

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


Parameters:

string   $username   The HTTP username

[ Top ]

method valid [line 271]

boolean valid( )

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



Tags:

access:  public


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

[ Top ]

method validateFragment [line 720]

boolean validateFragment( [string $fragment = null])

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.



Tags:

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


Parameters:

string   $fragment   Fragment of an URI

[ Top ]

method validateHost [line 430]

boolean validateHost( [string $host = null])

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.



Tags:

access:  public
uses:  Microsoft_Filter


Parameters:

string   $host   The HTTP host

[ Top ]

method validatePassword [line 364]

boolean validatePassword( [string $password = null])

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.



Tags:

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


Parameters:

string   $password   The HTTP password

[ Top ]

method validatePath [line 534]

boolean validatePath( [string $path = null])

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.



Tags:

throws:  Microsoft_Uri_Exception When path validation fails
access:  public


Parameters:

string   $path   The HTTP path

[ Top ]

method validatePort [line 481]

boolean validatePort( [string $port = null])

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.



Tags:

access:  public


Parameters:

string   $port   The HTTP port

[ Top ]

method validateQuery [line 612]

boolean validateQuery( [string $query = null])

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.



Tags:

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


Parameters:

string   $query   The query to validate

[ Top ]

method validateUsername [line 302]

boolean validateUsername( [string $username = null])

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.



Tags:

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


Parameters:

string   $username   The HTTP username

[ Top ]

method _parseUri [line 193]

void _parseUri( string $schemeSpecific)

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



Tags:

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


Parameters:

string   $schemeSpecific   The scheme-specific portion to parse

[ Top ]


Class Constants

CHAR_ALNUM =  'A-Za-z0-9'

[line 41]

Character classes for validation regular expressions


[ Top ]

CHAR_MARK =  '-_.!~*\'()\[\]'

[line 42]


[ Top ]

CHAR_RESERVED =  ';\/?:@&=+$,'

[line 43]


[ Top ]

CHAR_SEGMENT =  ':@&=+$,;'

[line 44]


[ Top ]

CHAR_UNWISE =  '{}|\\\\^`'

[line 45]


[ Top ]



Documentation generated on Wed, 18 May 2011 12:06:38 +0200 by phpDocumentor 1.4.3