wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
URIUtil Class Reference

Public Member Functions

 makeRelative ($abs_uri, $base)
 
 makeAbsolute ($rel_uri, $base, $REMOVE_LEADING_DOTS=true)
 
 translate ($rel_uri, $base)
 
 validateUrl ($url, $timeout=10)
 
 getProtocolStr ()
 
 getPageURL ()
 

Detailed Description

URIUtil provides support for uri manipulation.

wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH

Licensed under the terms of any of the following licenses at your choice:

See the license.txt file distributed with this work for additional information.

Id:
class.URIUtil.php 1462 2014-02-04 23:52:27Z iherwig
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 27 of file class.URIUtil.php.

Member Function Documentation

URIUtil::makeRelative (   $abs_uri,
  $base 
)

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

Parameters
abs_uriAbsolute URI to convert
baseBase URI

Definition at line 35 of file class.URIUtil.php.

Referenced by SaveController\executeKernel(), and translate().

URIUtil::makeAbsolute (   $rel_uri,
  $base,
  $REMOVE_LEADING_DOTS = true 
)

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

Parameters
rel_uriRelative URI to convert
baseBase URI
REMOVE_LEADING_DOTSTrue/False wether to remove leading dots or not [default: true]

Definition at line 68 of file class.URIUtil.php.

Referenced by ResourceListController\executeKernel(), LinkConverter\getBaseUrl(), PageExportController\initializeView(), and translate().

URIUtil::translate (   $rel_uri,
  $base 
)

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 141 of file class.URIUtil.php.

References makeAbsolute(), and makeRelative().

Referenced by smarty_function_image(), and smarty_function_translate_url().

+ Here is the call graph for this function:

URIUtil::validateUrl (   $url,
  $timeout = 10 
)

Check if an url is available (HTTP-Code: 200) code from http://de.php.net/fsockopen

Parameters
urlThe url to check
timeoutThe timeout in seconds (default: 10)
Returns
True/False wether the url is available

Definition at line 157 of file class.URIUtil.php.

References Log\debug(), and Log\isDebugEnabled().

+ Here is the call graph for this function:

URIUtil::getProtocolStr ( )

Definition at line 210 of file class.URIUtil.php.

Referenced by ResourceListController\executeKernel(), and getPageURL().

URIUtil::getPageURL ( )

Get the current page url

Returns
The url of the page

Definition at line 221 of file class.URIUtil.php.

References getProtocolStr().

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: