HTTP URI handler.
More...
|
| getUser () |
| Get the username part (before the ':') of the userInfo URI part.
|
|
| getPassword () |
| Get the password part (after the ':') of the userInfo URI part.
|
|
| getUserInfo () |
| Get the User-info (usually user:password) part.
|
|
| setUser ($user) |
| Set the username part (before the ':') of the userInfo URI part.
|
|
| setPassword ($password) |
| Set the password part (after the ':') of the userInfo URI part.
|
|
| setUserInfo ($userInfo) |
| Set the URI User-info part (usually user:password)
|
|
| getPort () |
| Return the URI port.
|
|
| parse ($uri) |
| Parse a URI string.
|
|
| __construct ($uri=null) |
| Create a new URI object.
|
|
| isValid () |
| Check if the URI is valid.
|
|
| isValidRelative () |
| Check if the URI is a valid relative URI.
|
|
| isAbsolute () |
| Check if the URI is an absolute or relative URI.
|
|
| parse ($uri) |
| Parse a URI string.
|
|
| toString () |
| Compose the URI into a string.
|
|
| normalize () |
| Normalize the URI.
|
|
| resolve ($baseUri) |
| Convert a relative URI into an absolute URI using a base absolute URI as a reference.
|
|
| makeRelative ($baseUri) |
| Convert the link to a relative link by substracting a base URI.
|
|
| getScheme () |
| Get the scheme part of the URI.
|
|
| getUserInfo () |
| Get the User-info (usually user:password) part.
|
|
| getHost () |
| Get the URI host.
|
|
| getPort () |
| Get the URI port.
|
|
| getPath () |
| Get the URI path.
|
|
| getQuery () |
| Get the URI query.
|
|
| getQueryAsArray () |
| Return the query string as an associative array of key => value pairs.
|
|
| getFragment () |
| Get the URI fragment.
|
|
| setScheme ($scheme) |
| Set the URI scheme.
|
|
| setUserInfo ($userInfo) |
| Set the URI User-info part (usually user:password)
|
|
| setHost ($host) |
| Set the URI host.
|
|
| setPort ($port) |
| Set the port part of the URI.
|
|
| setPath ($path) |
| Set the path.
|
|
| setQuery ($query) |
| Set the query string.
|
|
| setFragment ($fragment) |
| Set the URI fragment part.
|
|
| __toString () |
| Magic method to convert the URI to a string.
|
|
|
static | validateHost ($host, $allowed=self::HOST_DNS_OR_IPV4_OR_IPV6) |
| Validate the host part of an HTTP URI.
|
|
static | setEscaper (Escaper $escaper) |
| Set Escaper instance.
|
|
static | getEscaper () |
| Retrieve Escaper instance.
|
|
static | validateScheme ($scheme) |
| Encoding and Validation Methods.
|
|
static | validateUserInfo ($userInfo) |
| Check that the userInfo part of a URI is valid.
|
|
static | validateHost ($host, $allowed=self::HOST_ALL) |
| Validate the host part.
|
|
static | validatePort ($port) |
| Validate the port.
|
|
static | validatePath ($path) |
| Validate the path.
|
|
static | validateQueryFragment ($input) |
| Check if a URI query or fragment part is valid or not.
|
|
static | encodeUserInfo ($userInfo) |
| URL-encode the user info part of a URI.
|
|
static | encodePath ($path) |
| Encode the path.
|
|
static | encodeQueryFragment ($input) |
| URL-encode a query string or fragment based on RFC-3986 guidelines.
|
|
static | parseScheme ($uriString) |
| Extract only the scheme part out of a URI string.
|
|
static | removePathDotSegments ($path) |
| Remove any extra dot segments (/../, /.
|
|
static | merge ($baseUri, $relativeUri) |
| Merge a base URI and a relative URI into a new URI object.
|
|
|
| parseUserInfo () |
| Parse the user info into username and password segments.
|
|
| buildUserInfo () |
| Build the user info based on user and password.
|
|
| reset () |
| Reset URI parts.
|
|
Build the user info based on user and password.
Builds the user info based on the given user and password values
- Returns
- void
Get the password part (after the ':') of the userInfo URI part.
- Returns
- string|null
Return the URI port.
If no port is set, will return the default port according to the scheme
- Returns
- int
- See Also
- Zend::getPort()
Implements UriInterface.
Get the username part (before the ':') of the userInfo URI part.
- Returns
- string|null
Get the User-info (usually user:password) part.
- Returns
- string|null
Implements UriInterface.
Parse the user info into username and password segments.
Parses the user information into username and password segments, and then sets the appropriate values.
- Returns
- void
Set the password part (after the ':') of the userInfo URI part.
- Parameters
-
- Returns
- self
Set the username part (before the ':') of the userInfo URI part.
- Parameters
-
- Returns
- self
Set the URI User-info part (usually user:password)
- Parameters
-
- Returns
- self
- Exceptions
-
Exception\InvalidUriPartException | If the schema definition does not have this part |
Implements UriInterface.
static validateHost |
( |
|
$host, |
|
|
|
$allowed = self::HOST_DNS_OR_IPV4_OR_IPV6 |
|
) |
| |
|
static |
Validate the host part of an HTTP URI.
This overrides the common URI validation method with a DNS or IP only default. Users may still enforce allowing other host types.
- Parameters
-
- Returns
- bool
$validHostTypes = self::HOST_DNS_OR_IPV4_OR_IPV6_OR_REGNAME |
|
protected |