class AssetsPackage extends AbstractAssetsPackage implements AssetsPackageInterface

Methods

__construct(string $_root_dir, string $_assets_dir = null, string $_vendor_dir = null, string $_assets_vendor_dir = null)

Construction

setRootDirectory(string $path)

Set the project root directory absolute path

string
getRootDirectory()

Get the project root directory absolute path

setAssetsDirectory(string $path)

Set the project's assets directory, relative to $this->_root_dir

string
getAssetsDirectory()

Get the project's assets directory, relative to $this->_root_dir

setVendorDirectory(string $path)

Set the project's vendor directory, relative to $this->_root_dir

string
getVendorDirectory()

Get the project's vendor directory, relative to $this->_root_dir

setAssetsVendorDirectory(string $path)

Set the project's assets vendor directory, relative to $this->_assets_dir

string
getAssetsVendorDirectory()

Get the project's vendor directory, relative to $this->_root_dir

string
getFullPath(string $path, string $type = null, bool $out = false)

Get the absolute path in the package

string
getAssetsRealPath()

Get the assets full path

string
getVendorRealPath()

Get the assets full path

string
getAssetsVendorRealPath()

Get the assets vendor full path

static object
createFromAssetsLoader(Loader $loader)

Create a new instance from an AssetsManager\Loader instance

void
reset()

Reset the package to empty values (except for global package)

void
__clone()

Reset the package when clone

setName(string $name)

No description

string
getName()

No description

setVersion(string $version)

No description

string
getVersion()

No description

setRelativePath(string $path)

No description

string
getRelativePath()

No description

setAssetsPath(string $path)

No description

string
getAssetsPath()

No description

setAssetsPresets(array $presets)

No description

addAssetsPreset(string $preset_name, array $preset)

No description

array
getAssetsPresets()

No description

array|null
getAssetsPreset(string $preset_name)

No description

string
getRelativeFullPath(string $path)

Get the relative path in the package

array
getArray()

Get all necessary arranged package infos as an array

loadFromArray(array $entries)

Load a new package from the ASSETS_DB_FILENAME entry

string|null
findInPackage(string $filename)

Find an asset file in the filesystem of a specific package

find($filename)

No description

Details

at line 74
__construct(string $_root_dir, string $_assets_dir = null, string $_vendor_dir = null, string $_assets_vendor_dir = null)

Construction

Parameters

string $_root_dir The global package root directory (must exist)
string $_assets_dir The global package assets directory (must exist in $_root_dir)
string $_vendor_dir The global package vendor directory (must exist in $_root_dir)
string $_assets_vendor_dir The global package assets vendor directory (must exist in $_assets_dir)

Exceptions

Exception : any caught exception

in AbstractAssetsPackage at line 112
AbstractAssetsPackage setRootDirectory(string $path)

Set the project root directory absolute path

Parameters

string $path

Return Value

AbstractAssetsPackage

Exceptions

InvalidArgumentException if the path doesn't exist

in AbstractAssetsPackage at line 129
string getRootDirectory()

Get the project root directory absolute path

Return Value

string

in AbstractAssetsPackage at line 141
AbstractAssetsPackage setAssetsDirectory(string $path)

Set the project's assets directory, relative to $this->_root_dir

Parameters

string $path

Return Value

AbstractAssetsPackage

Exceptions

InvalidArgumentException if the path doesn't exist

in AbstractAssetsPackage at line 159
string getAssetsDirectory()

Get the project's assets directory, relative to $this->_root_dir

Return Value

string

in AbstractAssetsPackage at line 171
AbstractAssetsPackage setVendorDirectory(string $path)

Set the project's vendor directory, relative to $this->_root_dir

Parameters

string $path

Return Value

AbstractAssetsPackage

Exceptions

InvalidArgumentException if the path doesn't exist

in AbstractAssetsPackage at line 189
string getVendorDirectory()

Get the project's vendor directory, relative to $this->_root_dir

Return Value

string

in AbstractAssetsPackage at line 201
AbstractAssetsPackage setAssetsVendorDirectory(string $path)

Set the project's assets vendor directory, relative to $this->_assets_dir

Parameters

string $path

Return Value

AbstractAssetsPackage

Exceptions

InvalidArgumentException if the path doesn't exist

in AbstractAssetsPackage at line 219
string getAssetsVendorDirectory()

Get the project's vendor directory, relative to $this->_root_dir

Return Value

string

in AbstractAssetsPackage at line 236
string getFullPath(string $path, string $type = null, bool $out = false)

Get the absolute path in the package

Parameters

string $path The relative path to complete
string $type Type of the original relative path (can be asset, vendor or assets_vendor - default is null)
bool $out Must we search in assets and vendor (if false) or not (if true)

Return Value

string

in AbstractAssetsPackage at line 277
string getAssetsRealPath()

Get the assets full path

Return Value

string

in AbstractAssetsPackage at line 287
string getVendorRealPath()

Get the assets full path

Return Value

string

in AbstractAssetsPackage at line 297
string getAssetsVendorRealPath()

Get the assets vendor full path

Return Value

string

at line 96
static object createFromAssetsLoader(Loader $loader)

Create a new instance from an AssetsManager\Loader instance

Parameters

Loader $loader

Return Value

object

at line 112
void reset()

Reset the package to empty values (except for global package)

Return Value

void

at line 126
void __clone()

Reset the package when clone

Return Value

void

at line 139
AssetsPackage setName(string $name)

Parameters

string $name

Return Value

AssetsPackage

at line 148
string getName()

Return Value

string

at line 157
AssetsPackage setVersion(string $version)

Parameters

string $version

Return Value

AssetsPackage

at line 166
string getVersion()

Return Value

string

at line 175
AssetsPackage setRelativePath(string $path)

Parameters

string $path

Return Value

AssetsPackage

at line 184
string getRelativePath()

Return Value

string

at line 194
AssetsPackage setAssetsPath(string $path)

Parameters

string $path

Return Value

AssetsPackage

Exceptions

InvalidArgumentException if the path doesn't exist

at line 216
string getAssetsPath()

Return Value

string

at line 225
AssetsPackage setAssetsPresets(array $presets)

Parameters

array $presets

Return Value

AssetsPackage

at line 236
AssetsPackage addAssetsPreset(string $preset_name, array $preset)

Parameters

string $preset_name
array $preset

Return Value

AssetsPackage

at line 245
array getAssetsPresets()

Return Value

array

at line 254
array|null getAssetsPreset(string $preset_name)

Parameters

string $preset_name

Return Value

array|null

at line 269
string getRelativeFullPath(string $path)

Get the relative path in the package

Parameters

string $path The relative path to complete

Return Value

string

at line 285
array getArray()

Get all necessary arranged package infos as an array

This is the data stored in the Loader\Assets::ASSETS_DB_FILENAME.

Return Value

array

at line 303
AssetsPackage loadFromArray(array $entries)

Load a new package from the ASSETS_DB_FILENAME entry

Parameters

array $entries

Return Value

AssetsPackage

at line 325
string|null findInPackage(string $filename)

Find an asset file in the filesystem of a specific package

Parameters

string $filename The asset filename to find

Return Value

string|null The web path of the asset if found, null otherwise

at line 333
find($filename)

Parameters

$filename