Public Member Functions | |
__construct () | |
Constructor. | |
getServerURL () | |
getAbsolutePathURL () | |
getRelativePathURL () | |
getAbsoluteScriptURL () | |
getRelativeScriptURL () | |
getParams ($stripVarsPrefix=null) | |
getAbsoluteFullURL ($stripVarsPrefix=null) | |
getRelativeFullURL ($stripVarsPrefix=null) | |
Public Attributes | |
$type = "" | |
$host = "" | |
$port = "" | |
$path = "" | |
$script = "" | |
$params = null |
Examples:
$s = new SelfURL(); print ($s->getServerURL()); print ($s->getAbsolutePathURL()); print ($s->getAbsoluteScriptURL()); print ($s->getAbsoluteFullURL()); print ($s->getAbsoluteFullURL("strip_")); print ($s->getRelativePathURL()); print ($s->getRelativeScriptURL()); print ($s->getRelativeFullURL()); print ($s->getRelativeFullURL("strip_"));
With the following URL: http://example.com/svcmon/class.url.php?name=ferry&age=26&strip_foo=bar Outputs:
http://example.com http://example.com/svcmon http://example.com/svcmon/class.url.php http://example.com/svcmon/class.url.php?name=ferry&age=26&strip_foo=bar http://example.com/svcmon/class.url.php?name=ferry&age=26 /svcmon /svcmon/class.url.php /svcmon/class.url.php?name=ferry&age=26&strip_foo=bar /svcmon/class.url.php?name=ferry&age=26
Definition at line 904 of file tlib.php.
TLSelfURL::getAbsoluteFullURL | ( | $ | stripVarsPrefix = null |
) |
Returns the absolute URL upto and including the serialized parameters. I.e. "http://example.com/svcmon/class.url.php?name=ferry&age=26&strip_foo=bar".
Definition at line 1044 of file tlib.php.
References getAbsoluteScriptURL(), and getParams().
TLSelfURL::getAbsolutePathURL | ( | ) |
Returns the absolute URL upto and including the path to the script (but not the script name itself). I.e. "http://example.com/svcmon". Does not append a trailing backslash.
Definition at line 970 of file tlib.php.
References getServerURL().
TLSelfURL::getAbsoluteScriptURL | ( | ) |
Returns the absolute URL upto and including the script name. I.e. "http://example.com/svcmon/class.url.php".
Definition at line 992 of file tlib.php.
References getServerURL().
Referenced by getAbsoluteFullURL().
TLSelfURL::getParams | ( | $ | stripVarsPrefix = null |
) |
Returns a serialized form of the parameters of the URL. I.e. : "name=ferry&age=26&strip_foo=bar". If stripVarsPrefix is set, any variable starting with $stripVarsPrefix will not be included in the serialized parameters.
stripVarsPrefix | (string) Prefix of variables that need to be removed from the final result. |
Definition at line 1016 of file tlib.php.
Referenced by getAbsoluteFullURL(), and getRelativeFullURL().
TLSelfURL::getRelativeFullURL | ( | $ | stripVarsPrefix = null |
) |
Returns the relative URL upto and including the serialized parameters. I.e. "/svcmon/class.url.php?name=ferry&age=26&strip_foo=bar". Always starts with a slash.
Definition at line 1057 of file tlib.php.
References getParams(), and getRelativeScriptURL().
TLSelfURL::getRelativePathURL | ( | ) |
TLSelfURL::getRelativeScriptURL | ( | ) |
Returns the relative (to the Server URL) URL upto and including the script name. I.e. "/svcmon/class.url.php". Always starts with a slash.
Definition at line 1003 of file tlib.php.
Referenced by getRelativeFullURL().
TLSelfURL::getServerURL | ( | ) |
Returns the server URL. I.e. "https://example.com". If a non-default port was used (not 80 for http or not 443 for https), the port number will be appended to the URL.
Definition at line 956 of file tlib.php.
Referenced by getAbsolutePathURL(), and getAbsoluteScriptURL().
TLSelfURL::$params = null |
TLSelfURL::$path = "" |