|
| __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.
|
|
| 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.
|
|
Interface defining a URI.
Normalize the URI.
Normalizing a URI includes removing any redundant parent directory or current directory references from the path (e.g. foo/bar/../baz becomes foo/baz), normalizing the scheme case, decoding any over-encoded characters etc.
Eventually, two normalized URLs pointing to the same resource should be equal even if they were originally represented by two different strings
- Returns
- Uri
Implemented in Uri.
Set the URI host.
Note that the generic syntax for URIs allows using host names which are not necessarily IPv4 addresses or valid DNS host names. For example, IPv6 addresses are allowed as well, and also an abstract "registered name" which may be any name composed of a valid set of characters, including, for example, tilda (~) and underscore (_) which are not allowed in DNS names.
Subclasses of Uri may impose more strict validation of host names - for example the HTTP RFC clearly states that only IPv4 and valid DNS names are allowed in HTTP URIs.
- Parameters
-
- Exceptions
-
Exception\InvalidUriPartException | |
- Returns
- Uri
Implemented in Uri.