Detailed Description
URIUtil provides support for uri manipulation.
Definition at line 18 of file URIUtil.php.
Static Public Member Functions | |
static | makeRelative ($absUri, $base) |
static | makeAbsolute ($relUri, $base) |
static | translate ($pathFromA, $pathFromScriptToA) |
static | validateUrl ($url, $timeout=5) |
static | isHttps () |
static | getProtocolStr () |
Member Function Documentation
◆ makeRelative()
|
static |
Convert an absolute URI to a relative code from http://www.webmasterworld.com/forum88/334.htm.
- Parameters
-
$absUri Absolute URI at which the path should end, may have a trailing filename $base Absolute URI from which the relative should start
- Returns
- String
Definition at line 27 of file URIUtil.php.
◆ makeAbsolute()
|
static |
Convert a relative URI to an absolute code from http://99webtools.com/relative-path-into-absolute-url.php.
- Parameters
-
$relUri URI relative to base $base Absolute URI
- Returns
- String
Definition at line 66 of file URIUtil.php.
◆ translate()
|
static |
Translate a relative URI from one location to the script location.
For example if a file path is stored relative to location A and should be translated to the script URI (location B), use URIUtil::translate($filepathAsSeenFromA, $pathFromBtoA)
- Parameters
-
$pathFromA Relative URI to translate as seen from base $pathFromScriptToA Base URI
- Returns
- Associative array with keys 'absolute' and 'relative' and the absolute and relative URI (as seen from the executed script) as values
Definition at line 111 of file URIUtil.php.
◆ validateUrl()
|
static |
Check if an url is available (HTTP-Code: 200)
- Note
- requires cURL library
- Parameters
-
$url The url to check $timeout The timeout in seconds (default: 5)
- Returns
- Boolean
Definition at line 129 of file URIUtil.php.
◆ isHttps()
|
static |
Definition at line 155 of file URIUtil.php.
◆ getProtocolStr()
|
static |
Definition at line 169 of file URIUtil.php.