AbstractUri
class AbstractUri implements UriInterface (View source)
Uri Class
Abstract base for out uri classes.
This class should be considered an implementation detail. Typehint against UriInterface.
Constants
SCHEME_HTTP |
|
SCHEME_HTTPS |
|
Methods
Constructor.
Magic method to get the string representation of the URI object.
Returns full uri string.
Checks if variable exists.
Returns a query variable by name.
Returns flat query string.
Get URI scheme (protocol) ie. http, https, ftp, etc.
Get URI username Returns the username, or null if no username was specified.
Get URI password Returns the password, or null if no password was specified.
Retrieve the user information component of the URI.
Get URI host Returns the hostname/ip or null if no hostname/ip was specified.
Get URI port Returns the port number, or null if no port was specified.
Gets the URI path string.
Get the URI archor string Everything after the "#".
Checks whether the current URI is using HTTPS.
getUri
Details
at line line 93
__construct(string $uri = null)
Constructor.
You can pass a URI string to the constructor to initialise a specific URI.
at line line 108
string
__toString()
Magic method to get the string representation of the URI object.
at line line 122
string
toString(array $parts = array('scheme', 'user', 'pass', 'host', 'port', 'path', 'query', 'fragment'))
Returns full uri string.
at line line 149
boolean
hasVar(string $name)
Checks if variable exists.
at line line 164
array
getVar(string $name, string $default = null)
Returns a query variable by name.
at line line 183
string
getQuery(boolean $toArray = false)
Returns flat query string.
at line line 207
string
getScheme()
Get URI scheme (protocol) ie. http, https, ftp, etc.
..
at line line 220
string
getUser()
Get URI username Returns the username, or null if no username was specified.
at line line 233
string
getPass()
Get URI password Returns the password, or null if no password was specified.
at line line 255
string
getUserInfo()
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.
The trailing "@" character is not part of the user information and MUST NOT be added.
at line line 275
string
getHost()
Get URI host Returns the hostname/ip or null if no hostname/ip was specified.
at line line 288
integer
getPort()
Get URI port Returns the port number, or null if no port was specified.
at line line 300
string
getPath()
Gets the URI path string.
at line line 313
string
getFragment()
Get the URI archor string Everything after the "#".
at line line 325
boolean
isSSL()
Checks whether the current URI is using HTTPS.
at line line 384
string
getOriginal()
getUri