CHAR_SUB_DELIMS
CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='
Sub-delimiters used in query strings and fragments.
Abstraction for a uniform resource identifier (URI).
setURI(string|null $uri = null) : \CodeIgniter\HTTP\URI
Sets and overwrites any current URI information.
string|null | $uri |
getScheme() : string
Retrieve the scheme component of the URI.
If no scheme is present, this method MUST return an empty string.
The value returned MUST be normalized to lowercase, per RFC 3986 Section 3.1.
The trailing ":" character is not part of the scheme and MUST NOT be added.
The URI scheme.
getAuthority(boolean $ignorePort = false) : string
Retrieve the authority component of the URI.
If no authority information is present, this method MUST return an empty string.
The authority syntax of the URI is:
[user-info@]host[:port]
If the port component is not set or is the standard port for the current scheme, it SHOULD NOT be included.
boolean | $ignorePort |
The URI authority, in "[user-info@]host[:port]" format.
getUserInfo() : string|null
Retrieve the user information component of the URI.
If no user information is present, this method MUST return an empty string.
If a user is present in the URI, this will return that value; additionally, if the password is also present, it will be appended to the user value, with a colon (":") separating the values.
NOTE that be default, the password, if available, will NOT be shown as a security measure as discussed in RFC 3986, Section 7.5. If you know the password is not a security issue, you can force it to be shown with $this->showPassword();
The trailing "@" character is not part of the user information and MUST NOT be added.
The URI user information, in "username[:password]" format.
showPassword(boolean $val = true) : \CodeIgniter\HTTP\URI
Temporarily sets the URI to show a password in userInfo. Will reset itself after the first call to authority().
boolean | $val |
getPort() : null|integer
Retrieve the port component of the URI.
If a port is present, and it is non-standard for the current scheme, this method MUST return it as an integer. If the port is the standard port used with the current scheme, this method SHOULD return null.
If no port is present, and no scheme is present, this method MUST return a null value.
If no port is present, but a scheme is present, this method MAY return the standard port for that scheme, but SHOULD return null.
The URI port.
getPath() : string
Retrieve the path component of the URI.
The path can either be empty or absolute (starting with a slash) or rootless (not starting with a slash). Implementations MUST support all three syntaxes.
Normally, the empty path "" and absolute path "/" are considered equal as defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically do this normalization because in contexts with a trimmed base path, e.g. the front controller, this difference becomes significant. It's the task of the user to handle both "" and "/".
The value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986, Sections 2 and 3.3.
As an example, if the value should include a slash ("/") not intended as delimiter between path segments, that value MUST be passed in encoded form (e.g., "%2F") to the instance.
The URI path.
createURIString(string $scheme = null, string $authority = null, string $path = null, string $query = null, string $fragment = null) : string
Builds a representation of the string from the component parts.
string | $scheme | |
string | $authority | |
string | $path | |
string | $query | |
string | $fragment |
setQueryArray(array $query) : \CodeIgniter\HTTP\URI
A convenience method to pass an array of items in as the Query portion of the URI.
array | $query |
resolveRelativeURI(string $uri) : \CodeIgniter\HTTP\URI
Combines one URI string with this one based on the rules set out in RFC 3986 Section 2
string | $uri |
mergePaths(\CodeIgniter\HTTP\URI $base, \CodeIgniter\HTTP\URI $reference) : string
Given 2 paths, will merge them according to rules set out in RFC 2986, Section 5.2
\CodeIgniter\HTTP\URI | $base | |
\CodeIgniter\HTTP\URI | $reference |