Detailed Description

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 Public Member Functions

static makeRelative ($abs_uri, $base)
 
static makeAbsolute ($rel_uri, $base)
 
static translate ($rel_uri, $base)
 
static validateUrl ($url, $timeout=5)
 
static getProtocolStr ()
 
static getPageURL ()
 
static normalize ($paths)
 

Member Function Documentation

static makeRelative (   $abs_uri,
  $base 
)
static

Convert an absolute URI to a relative code from http://www.webmasterworld.com/forum88/334.htm.

Parameters
$abs_uriAbsolute URI to convert, may have a trailing filename
$baseBase URI

Definition at line 26 of file URIUtil.php.

static makeAbsolute (   $rel_uri,
  $base 
)
static

Convert a relative URI to an absolute code from http://99webtools.com/relative-path-into-absolute-url.php.

Parameters
$rel_uriRelative URI to convert
$baseBase URI

Definition at line 63 of file URIUtil.php.

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_uriRelative URI to translate as seen from base
$baseBase 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
$urlThe url to check
$timeoutThe timeout in seconds (default: 5)
Returns
Boolean whether the url is available

Definition at line 130 of file URIUtil.php.

static getProtocolStr ( )
static

Definition at line 156 of file URIUtil.php.

static getPageURL ( )
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
$pathsPath to normalize or array of paths

Definition at line 184 of file URIUtil.php.