Zend\Uri\Http
HTTP URI handler
Synopsis
class Http
extends Uri
{
- // Inherited constants from Uri
- const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~';
- const CHAR_GEN_DELIMS = ':\/\?#\[\]@';
- const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;=';
- const CHAR_RESERVED = ':\/\?#\[\]@!\$&\'\(\)\*\+,;=';
- const CHAR_QUERY_DELIMS = '!\$\'\(\)\*\,';
- const HOST_IPV4 = 0x01;
- const HOST_IPV6 = 0x02;
- const HOST_IPVFUTURE = 0x04;
- const HOST_IPVANY = 0x07;
- const HOST_DNS = 0x08;
- const HOST_DNS_OR_IPV4 = 0x09;
- const HOST_DNS_OR_IPV6 = 0x0A;
- const HOST_DNS_OR_IPV4_OR_IPV6 = 0x0B;
- const HOST_DNS_OR_IPVANY = 0x0F;
- const HOST_REGNAME = 0x10;
- const HOST_DNS_OR_IPV4_OR_IPV6_OR_REGNAME = 0x13;
- const HOST_ALL = 0x1F;
- // members
- protected array $validSchemes;
- protected array $defaultPorts;
- protected $validHostTypes;
- protected null|string $user;
- protected null|string $password;
- // Inherited members from Uri
- protected string $scheme;
- protected string $userInfo;
- protected string $host;
- protected int $port;
- protected string $path;
- protected string $query;
- protected string $fragment;
- protected int $validHostTypes;
- protected array $validSchemes;
- protected array $defaultPorts;
- protected Escaper $escaper;
- // methods
- public bool isValid()
- public null|string getUser()
- public string getPassword()
- public Http setUser()
- public Http setPassword()
- public static bool validateHost()
- protected void parseUserInfo()
- public int getPort()
- public Http parse()
- // Inherited methods from Uri
- public void __construct()
- public static void setEscaper()
- public static Escaper getEscaper()
- public bool isValid()
- public bool isValidRelative()
- public bool isAbsolute()
- protected void reset()
- public Uri parse()
- public string toString()
- public Uri normalize()
- public Uri resolve()
- public Uri makeRelative()
- public string|null getScheme()
- public string|null getUserInfo()
- public string|null getHost()
- public int|null getPort()
- public string|null getPath()
- public string|null getQuery()
- public array getQueryAsArray()
- public string|null getFragment()
- public Uri setScheme()
- public Uri setUserInfo()
- public Uri setHost()
- public Uri setPort()
- public Uri setPath()
- public Uri setQuery()
- public Uri setFragment()
- public string __toString()
- public static bool validateScheme()
- public static bool validateUserInfo()
- public static bool validateHost()
- public static bool validatePort()
- public static bool validatePath()
- public static bool validateQueryFragment()
- public static string encodeUserInfo()
- public static string encodePath()
- public static string encodeQueryFragment()
- public static string|null parseScheme()
- public static string removePathDotSegments()
- public static Uri merge()
- protected static bool isValidIpAddress()
- protected static bool isValidDnsHostname()
- protected static bool isValidRegName()
- protected static string normalizeScheme()
- protected static string normalizeHost()
- protected static int|null normalizePort()
- protected static string normalizePath()
- protected static string normalizeQuery()
- protected static string normalizeFragment()
- protected static mixed decodeUrlEncodedChars()
Hierarchy
Extends
Tasks
Line | Task |
---|---|
1092+ | consider optimizing |
Constants
Name | Value |
---|---|
CHAR_UNRESERVED | 'a-zA-Z0-9_\-\.~' |
CHAR_GEN_DELIMS | ':\/\?#\[\]@' |
CHAR_SUB_DELIMS | '!\$&\'\(\)\*\+,;=' |
CHAR_RESERVED | ':\/\?#\[\]@!\$&\'\(\)\*\+,;=' |
CHAR_QUERY_DELIMS | '!\$\'\(\)\*\,' |
HOST_IPV4 | 0x01 |
HOST_IPV6 | 0x02 |
HOST_IPVFUTURE | 0x04 |
HOST_IPVANY | 0x07 |
HOST_DNS | 0x08 |
HOST_DNS_OR_IPV4 | 0x09 |
HOST_DNS_OR_IPV6 | 0x0A |
HOST_DNS_OR_IPV4_OR_IPV6 | 0x0B |
HOST_DNS_OR_IPVANY | 0x0F |
HOST_REGNAME | 0x10 |
HOST_DNS_OR_IPV4_OR_IPV6_OR_REGNAME | 0x13 |
HOST_ALL | 0x1F |
Members
protected
- $defaultPorts
- $defaultPorts
—
array
List of default ports per scheme - $escaper — Zend\Escaper\Escaper
- $fragment
—
string
URI fragment - $host
—
string
URI hostname - $password
—
Zend\Uri\null|string
Password as provided in authority of URI - $path
—
string
URI path - $port
—
int
URI port - $query
—
string
URI query string - $scheme
—
string
URI scheme - $user
—
Zend\Uri\null|string
User name as provided in authority of URI - $userInfo
—
string
URI userInfo part (usually user:password in HTTP URLs) - $validHostTypes
- $validHostTypes
—
int
Which host part types are valid for this URI? - $validSchemes
- $validSchemes
—
array
Array of valid schemes.
Methods
protected
- parseUserInfo() — Parse the user info into username and password segments
public
- getPassword() — Get the password part (after the ':') of the userInfo URI part
- getPort() — Return the URI port
- getUser() — Get the username part (before the ':') of the userInfo URI part
- isValid() — Check if the URI is a valid HTTP URI
- parse() — Parse a URI string
- setPassword() — Set the password part (after the ':') of the userInfo URI part
- setUser() — Set the username part (before the ':') of the userInfo URI part
- validateHost() — Validate the host part of an HTTP URI
Inherited from Zend\Uri\Uri
protected
- decodeUrlEncodedChars() — Decode all percent encoded characters which are allowed to be represented literally
- isValidDnsHostname() — Check if an address is a valid DNS hostname
- isValidIpAddress() — Check if a host name is a valid IP address, depending on allowed IP address types
- isValidRegName() — Check if an address is a valid registered name (as defined by RFC-3986) address
- normalizeFragment() — Normalize the fragment part
- normalizeHost() — Normalize the host part
- normalizePath() — Normalize the path
- normalizePort() — Normalize the port
- normalizeQuery() — Normalize the query part
- normalizeScheme() — Normalize the scheme
- reset() — Reset URI parts
public
- __toString() — Magic method to convert the URI to a string
- encodePath() — Encode the path
- encodeQueryFragment() — URL-encode a query string or fragment based on RFC-3986 guidelines.
- encodeUserInfo() — URL-encode the user info part of a URI
- getEscaper() — Retrieve Escaper instance
- getFragment() — Get the URI fragment
- getHost() — Get the URI host
- getPath() — Get the URI path
- getPort() — Get the URI port
- getQuery() — Get the URI query
- getQueryAsArray() — Return the query string as an associative array of key => value pairs
- getScheme() — Get the scheme part of the URI
- getUserInfo() — Get the User-info (usually user:password) part
- isAbsolute() — Check if the URI is an absolute or relative URI
- isValid() — Check if the URI is valid
- isValidRelative() — Check if the URI is a valid relative URI
- makeRelative() — Convert the link to a relative link by substracting a base URI
- merge() — Merge a base URI and a relative URI into a new URI object
- normalize() — Normalize the URI
- parse() — Parse a URI string
- parseScheme() — Extract only the scheme part out of a URI string.
- removePathDotSegments() — Remove any extra dot segments (/../, /./) from a path
- resolve() — Convert a relative URI into an absolute URI using a base absolute URI as a reference.
- setEscaper() — Set Escaper instance
- setFragment() — Set the URI fragment part
- setHost() — Set the URI host
- setPath() — Set the path
- setPort() — Set the port part of the URI
- setQuery() — Set the query string
- setScheme() — Set the URI scheme
- setUserInfo() — Set the URI User-info part (usually user:password)
- toString() — Compose the URI into a string
- validateHost() — Validate the host part
- validatePath() — Validate the path
- validatePort() — Validate the port
- validateQueryFragment() — Check if a URI query or fragment part is valid or not
- validateScheme() — Check if a scheme is valid or not
- validateUserInfo() — Check that the userInfo part of a URI is valid