AbstractAssetsPackage
abstract class AbstractAssetsPackage
Class to manage assets paths
The class is based on three paths:
base_dir
: the package root directory (must be the directory containing thecomposer.json
file)assets_dir
: the package asssets directory related tobase_dir
document_root
: the path in the filesystem of the web assets root directory ; this is used to build all related assets paths to use in HTTP.
For these three paths, their defaults values are defined on a default package structure:
package_name/
|----------- src/
|----------- www/
$loader->base_dir = realpath(package_name)
$loader->assets_dir = www
$loader->document_root = www or the server DOCUMENT_ROOT
NOTE - These paths are stored in the object without the trailing slash.
Methods
No description
Set the project root directory absolute path
Get the project root directory absolute path
Set the project's assets directory, relative to $this->_root_dir
Get the project's assets directory, relative to $this->_root_dir
Set the project's vendor directory, relative to $this->_root_dir
Get the project's vendor directory, relative to $this->_root_dir
Set the project's assets vendor directory, relative to $this->_assets_dir
Get the project's vendor directory, relative to $this->_root_dir
Get the absolute path in the package
Get the assets full path
Get the assets full path
Get the assets vendor full path
Details
at line 86
__construct(string $root_dir = null, string $assets_dir = null, string $vendor_dir = null, string $assets_vendor_dir = null)
at line 112
AbstractAssetsPackage
setRootDirectory(string $path)
Set the project root directory absolute path
at line 129
string
getRootDirectory()
Get the project root directory absolute path
at line 141
AbstractAssetsPackage
setAssetsDirectory(string $path)
Set the project's assets directory, relative to $this->_root_dir
at line 159
string
getAssetsDirectory()
Get the project's assets directory, relative to $this->_root_dir
at line 171
AbstractAssetsPackage
setVendorDirectory(string $path)
Set the project's vendor directory, relative to $this->_root_dir
at line 189
string
getVendorDirectory()
Get the project's vendor directory, relative to $this->_root_dir
at line 201
AbstractAssetsPackage
setAssetsVendorDirectory(string $path)
Set the project's assets vendor directory, relative to $this->_assets_dir
at line 219
string
getAssetsVendorDirectory()
Get the project's vendor directory, relative to $this->_root_dir
at line 236
string
getFullPath(string $path, string $type = null, bool $out = false)
Get the absolute path in the package
at line 277
string
getAssetsRealPath()
Get the assets full path
at line 287
string
getVendorRealPath()
Get the assets full path
at line 297
string
getAssetsVendorRealPath()
Get the assets vendor full path