\rex_path

Utility class to generate absolute paths.

Summary

Methods
Properties
Constants
init()
base()
frontend()
frontendController()
backend()
backendController()
media()
assets()
coreAssets()
addonAssets()
pluginAssets()
bin()
data()
coreData()
addonData()
pluginData()
log()
cache()
coreCache()
addonCache()
pluginCache()
src()
core()
addon()
plugin()
absolute()
relative()
basename()
No public properties found
No constants found
No protected methods found
$pathprovider
N/A
No private methods found
No private properties found
N/A

Properties

Methods

init()

init(\rex_path_default_provider  $pathprovider) : mixed

Initializes the class.

Parameters

\rex_path_default_provider $pathprovider

A path provider

Returns

mixed —

base()

base(string  $file = '') : string

Returns the base/root path.

Parameters

string $file

File

Returns

string —

frontend()

frontend(string  $file = '') : string

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

Parameters

string $file

File

Returns

string —

frontendController()

frontendController() : string

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

Returns

string —

backend()

backend(string  $file = '') : string

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

Parameters

string $file

File

Returns

string —

backendController()

backendController() : string

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

Returns

string —

media()

media(string  $file = '') : string

Returns the path to the media-folder.

Parameters

string $file

File

Returns

string —

assets()

assets(string  $file = '') : string

Returns the path to the assets folder.

Parameters

string $file

File

Returns

string —

coreAssets()

coreAssets(string  $file = '') : string

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

Parameters

string $file

File

Returns

string —

addonAssets()

addonAssets(string  $addon, string  $file = '') : string

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

Parameters

string $addon

Addon

string $file

File

Returns

string —

pluginAssets()

pluginAssets(string  $addon, string  $plugin, string  $file = '') : string

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

Parameters

string $addon

Addon

string $plugin

Plugin

string $file

File

Returns

string —

bin()

bin(string  $file = '') : string

Returns the path to the bin folder.

Parameters

string $file

File

Returns

string —

data()

data(string  $file = '') : string

Returns the path to the data folder.

Parameters

string $file

File

Returns

string —

coreData()

coreData(string  $file = '') : string

Returns the path to the data folder of the core.

Parameters

string $file

File

Returns

string —

addonData()

addonData(string  $addon, string  $file = '') : string

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

Parameters

string $addon

Addon

string $file

File

Returns

string —

pluginData()

pluginData(string  $addon, string  $plugin, string  $file = '') : string

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

Parameters

string $addon

Addon

string $plugin

Plugin

string $file

File

Returns

string —

log()

log(string  $file = '') : string

Returns the path to the cache folder.

Parameters

string $file

Returns

string —

cache()

cache(string  $file = '') : string

Returns the path to the cache folder.

Parameters

string $file

File

Returns

string —

coreCache()

coreCache(string  $file = '') : string

Returns the path to the cache folder of the core.

Parameters

string $file

File

Returns

string —

addonCache()

addonCache(string  $addon, string  $file = '') : string

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

Parameters

string $addon

Addon

string $file

File

Returns

string —

pluginCache()

pluginCache(string  $addon, string  $plugin, string  $file = '') : string

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

Parameters

string $addon

Addon

string $plugin

Plugin

string $file

File

Returns

string —

src()

src(string  $file = '') : string

Returns the path to the src folder.

Parameters

string $file

File

Returns

string —

core()

core(string  $file = '') : string

Returns the path to the actual core.

Parameters

string $file

File

Returns

string —

addon()

addon(string  $addon, string  $file = '') : string

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

Parameters

string $addon

Addon

string $file

File

Returns

string —

plugin()

plugin(string  $addon, string  $plugin, string  $file = '') : string

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

Parameters

string $addon

Addon

string $plugin

Plugin

string $file

File

Returns

string —

absolute()

absolute(string  $relPath) : string

Converts a relative path to an absolute.

Parameters

string $relPath

The relative path

Returns

string —

Absolute path

relative()

relative(string  $absPath, null|string  $basePath = null) : string

Converts an absolute path to a relative one.

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

Parameters

string $absPath
null|string $basePath

Defaults to rex_path::base()

Returns

string —

basename()

basename(string  $path) : string

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

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

Parameters

string $path

Returns

string —