URIUtil provides support for uri manipulation.
- Author
- ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m
Definition at line 18 of file URIUtil.php.
static makeRelative |
( |
|
$abs_uri, |
|
|
|
$base |
|
) |
| |
|
static |
static makeAbsolute |
( |
|
$rel_uri, |
|
|
|
$base |
|
) |
| |
|
static |
static translate |
( |
|
$rel_uri, |
|
|
|
$base |
|
) |
| |
|
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
-
$rel_uri | Relative URI to translate as seen from base |
$base | Base URI |
- Returns
- An associtative array with keys 'absolute' and 'relative' and the absolute and relative URI (as seen from the executed script) as values
Definition at line 112 of file URIUtil.php.
static validateUrl |
( |
|
$url, |
|
|
|
$timeout = 5 |
|
) |
| |
|
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 whether the url is available
Definition at line 130 of file URIUtil.php.
static getProtocolStr |
( |
| ) |
|
|
static |
Get the current page url.
- Returns
- The url of the page
Definition at line 169 of file URIUtil.php.
static normalize |
( |
|
$paths | ) |
|
|
static |
Normalize slashes and remove drive names.
- Parameters
-
$paths | Path to normalize or array of paths |
Definition at line 184 of file URIUtil.php.