Documentation

rex_path
in package

Utility class to generate absolute paths.

Tags
author

gharlan

Table of Contents

Properties

$pathprovider  : rex_path_default_provider

Methods

absolute()  : string
Converts a relative path to an absolute.
addon()  : non-empty-string
Returns the base path to the folder of the given addon.
addonAssets()  : non-empty-string
Returns the path to the public assets folder of the given addon.
addonCache()  : non-empty-string
Returns the path to the cache folder of the given addon.
addonData()  : non-empty-string
Returns the path to the data folder of the given addon.
assets()  : non-empty-string
Returns the path to the assets folder.
backend()  : non-empty-string
Returns the path to the backend (folder where the backend controller is placed).
backendController()  : non-empty-string
Returns the path to the backend-controller (index.php from backend).
base()  : non-empty-string
Returns the base/root path.
basename()  : string
Returns the basename (filename) of the path independent of directory separator (/ or \).
bin()  : non-empty-string
Returns the path to the bin folder.
cache()  : non-empty-string
Returns the path to the cache folder.
core()  : non-empty-string
Returns the path to the actual core.
coreAssets()  : non-empty-string
Returns the path to the assets folder of the core, which contains all assets required by the core to work properly.
coreCache()  : non-empty-string
Returns the path to the cache folder of the core.
coreData()  : non-empty-string
Returns the path to the data folder of the core.
data()  : non-empty-string
Returns the path to the data folder.
findBinaryPath()  : non-empty-string|null
frontend()  : non-empty-string
Returns the path to the frontend (the document root).
frontendController()  : non-empty-string
Returns the path to the frontend-controller (index.php from frontend).
init()  : void
Initializes the class.
log()  : non-empty-string
Returns the path to the cache folder.
media()  : non-empty-string
Returns the path to the media-folder.
plugin()  : non-empty-string
Returns the base path to the folder of the plugin of the given addon.
pluginAssets()  : non-empty-string
Returns the path to the public assets folder of the given plugin of the given addon.
pluginCache()  : non-empty-string
Returns the path to the cache folder of the given plugin.
pluginData()  : non-empty-string
Returns the path to the data folder of the given plugin of the given addon.
relative()  : string
Converts an absolute path to a relative one.
src()  : non-empty-string
Returns the path to the src folder.

Properties

Methods

absolute()

Converts a relative path to an absolute.

public static absolute(non-empty-string $relPath) : string
Parameters
$relPath : non-empty-string

The relative path

Return values
string

Absolute path

addon()

Returns the base path to the folder of the given addon.

public static addon(non-empty-string $addon[, string $file = '' ]) : non-empty-string
Parameters
$addon : non-empty-string

Addon

$file : string = ''

File

Return values
non-empty-string

addonAssets()

Returns the path to the public assets folder of the given addon.

public static addonAssets(non-empty-string $addon[, string $file = '' ]) : non-empty-string
Parameters
$addon : non-empty-string

Addon

$file : string = ''

File

Tags
see
assets()
Return values
non-empty-string

addonCache()

Returns the path to the cache folder of the given addon.

public static addonCache(non-empty-string $addon[, string $file = '' ]) : non-empty-string
Parameters
$addon : non-empty-string

Addon

$file : string = ''

File

Return values
non-empty-string

addonData()

Returns the path to the data folder of the given addon.

public static addonData(non-empty-string $addon[, string $file = '' ]) : non-empty-string
Parameters
$addon : non-empty-string

Addon

$file : string = ''

File

Return values
non-empty-string

assets()

Returns the path to the assets folder.

public static assets([string $file = '' ]) : non-empty-string
Parameters
$file : string = ''

File

Return values
non-empty-string

backend()

Returns the path to the backend (folder where the backend controller is placed).

public static backend([string $file = '' ]) : non-empty-string
Parameters
$file : string = ''

File

Return values
non-empty-string

backendController()

Returns the path to the backend-controller (index.php from backend).

public static backendController() : non-empty-string
Return values
non-empty-string

base()

Returns the base/root path.

public static base([string $file = '' ]) : non-empty-string
Parameters
$file : string = ''

File

Return values
non-empty-string

basename()

Returns the basename (filename) of the path independent of directory separator (/ or \).

public static basename(string $path) : string

This method should be used to secure incoming GET/POST parameters containing a filename.

Parameters
$path : string
Return values
string

bin()

Returns the path to the bin folder.

public static bin([string $file = '' ]) : non-empty-string
Parameters
$file : string = ''

File

Return values
non-empty-string

cache()

Returns the path to the cache folder.

public static cache([string $file = '' ]) : non-empty-string
Parameters
$file : string = ''

File

Return values
non-empty-string

core()

Returns the path to the actual core.

public static core([string $file = '' ]) : non-empty-string
Parameters
$file : string = ''

File

Return values
non-empty-string

coreAssets()

Returns the path to the assets folder of the core, which contains all assets required by the core to work properly.

public static coreAssets([string $file = '' ]) : non-empty-string
Parameters
$file : string = ''

File

Return values
non-empty-string

coreCache()

Returns the path to the cache folder of the core.

public static coreCache([string $file = '' ]) : non-empty-string
Parameters
$file : string = ''

File

Return values
non-empty-string

coreData()

Returns the path to the data folder of the core.

public static coreData([string $file = '' ]) : non-empty-string
Parameters
$file : string = ''

File

Return values
non-empty-string

data()

Returns the path to the data folder.

public static data([string $file = '' ]) : non-empty-string
Parameters
$file : string = ''

File

Return values
non-empty-string

findBinaryPath()

public static findBinaryPath(string $commandName) : non-empty-string|null
Parameters
$commandName : string
Return values
non-empty-string|null

frontend()

Returns the path to the frontend (the document root).

public static frontend([string $file = '' ]) : non-empty-string
Parameters
$file : string = ''

File

Return values
non-empty-string

frontendController()

Returns the path to the frontend-controller (index.php from frontend).

public static frontendController() : non-empty-string
Return values
non-empty-string

log()

Returns the path to the cache folder.

public static log([string $file = '' ]) : non-empty-string
Parameters
$file : string = ''
Return values
non-empty-string

media()

Returns the path to the media-folder.

public static media([string $file = '' ]) : non-empty-string
Parameters
$file : string = ''

File

Return values
non-empty-string

plugin()

Returns the base path to the folder of the plugin of the given addon.

public static plugin(non-empty-string $addon, non-empty-string $plugin[, string $file = '' ]) : non-empty-string
Parameters
$addon : non-empty-string

Addon

$plugin : non-empty-string

Plugin

$file : string = ''

File

Return values
non-empty-string

pluginAssets()

Returns the path to the public assets folder of the given plugin of the given addon.

public static pluginAssets(non-empty-string $addon, non-empty-string $plugin[, string $file = '' ]) : non-empty-string
Parameters
$addon : non-empty-string

Addon

$plugin : non-empty-string

Plugin

$file : string = ''

File

Tags
see
assets()
Return values
non-empty-string

pluginCache()

Returns the path to the cache folder of the given plugin.

public static pluginCache(non-empty-string $addon, non-empty-string $plugin[, string $file = '' ]) : non-empty-string
Parameters
$addon : non-empty-string

Addon

$plugin : non-empty-string

Plugin

$file : string = ''

File

Return values
non-empty-string

pluginData()

Returns the path to the data folder of the given plugin of the given addon.

public static pluginData(non-empty-string $addon, non-empty-string $plugin[, string $file = '' ]) : non-empty-string
Parameters
$addon : non-empty-string

Addon

$plugin : non-empty-string

Plugin

$file : string = ''

File

Return values
non-empty-string

relative()

Converts an absolute path to a relative one.

public static relative(string $absPath[, string|null $basePath = null ]) : string

If the path is outside of the base path, the absolute path will be kept.

Parameters
$absPath : string
$basePath : string|null = null

Defaults to rex_path::base()

Return values
string

src()

Returns the path to the src folder.

public static src([string $file = '' ]) : non-empty-string
Parameters
$file : string = ''

File

Return values
non-empty-string

        
On this page

Search results