Uri/Http.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Uri
- Version
- $Id$
Package: Zend_UriHTTP(S) URI handler
- Parent(s)
- \Zend_Uri
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Uses
-
Constants
Properties
array $_regex = array()
Regular expression grammar rules for validation; values added by constructor
Default valuearray()
Details- Type
- array
Methods
__construct(string $scheme, string $schemeSpecific = '') : void
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)
ParametersName | Type | Description |
---|
$scheme | string | The scheme of the URI |
---|
$schemeSpecific | string | The scheme-specific part of the URI |
---|
Throws _parseUri(string $schemeSpecific) : void
Parse the scheme-specific portion of the URI and place its parts into instance variables.
ParametersName | Type | Description |
---|
$schemeSpecific | string | The scheme-specific portion to parse |
---|
Throws addReplaceQueryParameters(array $queryParams) : string
Add or replace params in the query string for the current URI, and
return the old query.
ParametersName | Type | Description |
---|
$queryParams | array | |
---|
ReturnsType | Description |
---|
string | Old query string |
fromString(string $uri) : \Zend_Uri_Http
staticCreates a Zend_Uri_Http from the given string
ParametersName | Type | Description |
---|
$uri | string | String to create URI from, must start with
'http://' or 'https://'
|
---|
ReturnsThrows getFragment() : string | false
Returns the fragment portion of the URL (after #), or FALSE if none.
ReturnsType | Description |
---|
string | false | |
removeQueryParameters(array $queryParamKeys) : string
Remove params in the query string for the current URI, and
return the old query.
ParametersName | Type | Description |
---|
$queryParamKeys | array | |
---|
ReturnsType | Description |
---|
string | Old query string |
setFragment(string $fragment) : string
Sets the fragment for the current URI, and returns the old fragment
ParametersName | Type | Description |
---|
$fragment | string | Fragment of the current URI |
---|
ReturnsThrows setHost(string $host) : string
Sets the host for the current URI, and returns the old host
ParametersName | Type | Description |
---|
$host | string | The HTTP host |
---|
ReturnsThrows setPassword(string $password) : string
Sets the password for the current URI, and returns the old password
ParametersName | Type | Description |
---|
$password | string | The HTTP password |
---|
ReturnsThrows setPath(string $path) : string
Sets the path for the current URI, and returns the old path
ParametersName | Type | Description |
---|
$path | string | The HTTP path |
---|
ReturnsThrows setPort(string $port) : string
Sets the port for the current URI, and returns the old port
ParametersName | Type | Description |
---|
$port | string | The HTTP port |
---|
ReturnsThrows setQuery(string | array $query) : string
Set the query string for the current URI, and return the old query
string This method accepts both strings and arrays.
ParametersName | Type | Description |
---|
$query | string | array | The query string or array |
---|
ReturnsType | Description |
---|
string | Old query string |
Throws setUsername(string $username) : string
Sets the username for the current URI, and returns the old username
ParametersName | Type | Description |
---|
$username | string | The HTTP username |
---|
ReturnsThrows validateHost(string $host = null) : boolean
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.
ParametersName | Type | Description |
---|
$host | string | The HTTP host |
---|
ReturnsDetails- Uses
-
validatePath(string $path = null) : boolean
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.
ParametersName | Type | Description |
---|
$path | string | The HTTP path |
---|
ReturnsThrows validatePort(string $port = null) : boolean
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.
ParametersName | Type | Description |
---|
$port | string | The HTTP port |
---|
Returns