rex_path
in package
Utility class to generate absolute paths.
Tags
Table of Contents
Properties
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
$pathprovider
protected
static rex_path_default_provider
$pathprovider
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-stringaddonAssets()
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
Return values
non-empty-stringaddonCache()
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-stringaddonData()
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-stringassets()
Returns the path to the assets folder.
public
static assets([string $file = '' ]) : non-empty-string
Parameters
- $file : string = ''
-
File
Return values
non-empty-stringbackend()
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-stringbackendController()
Returns the path to the backend-controller (index.php from backend).
public
static backendController() : non-empty-string
Return values
non-empty-stringbase()
Returns the base/root path.
public
static base([string $file = '' ]) : non-empty-string
Parameters
- $file : string = ''
-
File
Return values
non-empty-stringbasename()
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
stringbin()
Returns the path to the bin folder.
public
static bin([string $file = '' ]) : non-empty-string
Parameters
- $file : string = ''
-
File
Return values
non-empty-stringcache()
Returns the path to the cache folder.
public
static cache([string $file = '' ]) : non-empty-string
Parameters
- $file : string = ''
-
File
Return values
non-empty-stringcore()
Returns the path to the actual core.
public
static core([string $file = '' ]) : non-empty-string
Parameters
- $file : string = ''
-
File
Return values
non-empty-stringcoreAssets()
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-stringcoreCache()
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-stringcoreData()
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-stringdata()
Returns the path to the data folder.
public
static data([string $file = '' ]) : non-empty-string
Parameters
- $file : string = ''
-
File
Return values
non-empty-stringfindBinaryPath()
public
static findBinaryPath(string $commandName) : non-empty-string|null
Parameters
- $commandName : string
Return values
non-empty-string|nullfrontend()
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-stringfrontendController()
Returns the path to the frontend-controller (index.php from frontend).
public
static frontendController() : non-empty-string
Return values
non-empty-stringinit()
Initializes the class.
public
static init(rex_path_default_provider $pathprovider) : void
Parameters
- $pathprovider : rex_path_default_provider
-
A path provider
log()
Returns the path to the cache folder.
public
static log([string $file = '' ]) : non-empty-string
Parameters
- $file : string = ''
Return values
non-empty-stringmedia()
Returns the path to the media-folder.
public
static media([string $file = '' ]) : non-empty-string
Parameters
- $file : string = ''
-
File
Return values
non-empty-stringplugin()
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-stringpluginAssets()
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
Return values
non-empty-stringpluginCache()
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-stringpluginData()
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-stringrelative()
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
stringsrc()
Returns the path to the src folder.
public
static src([string $file = '' ]) : non-empty-string
Parameters
- $file : string = ''
-
File