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 ($absUri, $base)
 
static makeAbsolute ($relUri, $base)
 
static translate ($pathFromA, $pathFromScriptToA)
 
static validateUrl ($url, $timeout=5)
 
static isHttps ()
 
static getProtocolStr ()
 

Member Function Documentation

◆ makeRelative()

static makeRelative (   $absUri,
  $base 
)
static

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

Parameters
$absUriAbsolute URI at which the path should end, may have a trailing filename
$baseAbsolute URI from which the relative should start
Returns
String

Definition at line 27 of file URIUtil.php.

◆ makeAbsolute()

static makeAbsolute (   $relUri,
  $base 
)
static

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

Parameters
$relUriURI relative to base
$baseAbsolute URI
Returns
String

Definition at line 66 of file URIUtil.php.

◆ translate()

static translate (   $pathFromA,
  $pathFromScriptToA 
)
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
$pathFromARelative URI to translate as seen from base
$pathFromScriptToABase 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 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

Definition at line 129 of file URIUtil.php.

◆ isHttps()

static isHttps ( )
static

Definition at line 155 of file URIUtil.php.

◆ getProtocolStr()

static getProtocolStr ( )
static

Definition at line 169 of file URIUtil.php.