ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
A base abstract asset. More...
Public Member Functions | |
__construct ($filters=array(), $sourceRoot=null, $sourcePath=null, array $vars=array()) | |
Constructor. More... | |
__clone () | |
ensureFilter (FilterInterface $filter) | |
Ensures the current asset includes the supplied filter. More... | |
getFilters () | |
Returns an array of filters currently applied. More... | |
clearFilters () | |
Clears all filters from the current asset. More... | |
dump (FilterInterface $additionalFilter=null) | |
Applies dump filters and returns the asset as a string. More... | |
getContent () | |
Returns the loaded content of the current asset. More... | |
setContent ($content) | |
Sets the content of the current asset. More... | |
getSourceRoot () | |
Returns an absolute path or URL to the source asset's root directory. More... | |
getSourcePath () | |
Returns the relative path for the source asset. More... | |
getSourceDirectory () | |
Returns the asset's source directory. More... | |
getTargetPath () | |
Returns the URL for the current asset. More... | |
setTargetPath ($targetPath) | |
Sets the URL for the current asset. More... | |
getVars () | |
Returns an array of variable names for this asset. More... | |
setValues (array $values) | |
Sets the values for the asset's variables. More... | |
getValues () | |
Returns the current values for this asset. More... | |
Public Member Functions inherited from Assetic\Asset\AssetInterface | |
load (FilterInterface $additionalFilter=null) | |
Loads the asset into memory and applies load filters. More... | |
getLastModified () | |
Returns the time the current asset was last modified. More... | |
Protected Member Functions | |
doLoad ($content, FilterInterface $additionalFilter=null) | |
Encapsulates asset loading logic. More... | |
Private Attributes | |
$filters | |
$sourceRoot | |
$sourcePath | |
$sourceDir | |
$targetPath | |
$content | |
$loaded | |
$vars | |
$values | |
A base abstract asset.
The methods load() and getLastModified() are left undefined, although a reusable doLoad() method is available to child classes.
Definition at line 25 of file BaseAsset.php.
Assetic\Asset\BaseAsset::__construct | ( | $filters = array() , |
|
$sourceRoot = null , |
|||
$sourcePath = null , |
|||
array | $vars = array() |
||
) |
Constructor.
array | $filters | Filters for the asset |
string | $sourceRoot | The root directory |
string | $sourcePath | The asset path |
array | $vars |
Definition at line 45 of file BaseAsset.php.
References Assetic\Asset\BaseAsset\$filters, Assetic\Asset\BaseAsset\$sourcePath, Assetic\Asset\BaseAsset\$sourceRoot, Assetic\Asset\BaseAsset\$vars, and array.
Assetic\Asset\BaseAsset::__clone | ( | ) |
Assetic\Asset\BaseAsset::clearFilters | ( | ) |
Clears all filters from the current asset.
Implements Assetic\Asset\AssetInterface.
Definition at line 73 of file BaseAsset.php.
|
protected |
Encapsulates asset loading logic.
string | $content | The asset content |
FilterInterface | $additionalFilter | An additional filter |
Definition at line 84 of file BaseAsset.php.
References Assetic\Asset\BaseAsset\$content, and Assetic\Asset\BaseAsset\$filters.
Referenced by Assetic\Asset\StringAsset\load(), Assetic\Asset\HttpAsset\load(), and Assetic\Asset\FileAsset\load().
Assetic\Asset\BaseAsset::dump | ( | FilterInterface | $additionalFilter = null | ) |
Applies dump filters and returns the asset as a string.
You may provide an additional filter to apply during dump.
Dumping an asset should not change its state.
If the current asset has not been loaded yet, it should be automatically loaded at this time.
FilterInterface | $additionalFilter | An additional filter |
Implements Assetic\Asset\AssetInterface.
Definition at line 100 of file BaseAsset.php.
References Assetic\Asset\BaseAsset\$filters, and Assetic\Asset\AssetInterface\load().
Assetic\Asset\BaseAsset::ensureFilter | ( | FilterInterface | $filter | ) |
Ensures the current asset includes the supplied filter.
FilterInterface | $filter | A filter |
Implements Assetic\Asset\AssetInterface.
Definition at line 63 of file BaseAsset.php.
Assetic\Asset\BaseAsset::getContent | ( | ) |
Returns the loaded content of the current asset.
Implements Assetic\Asset\AssetInterface.
Definition at line 117 of file BaseAsset.php.
References Assetic\Asset\BaseAsset\$content.
Assetic\Asset\BaseAsset::getFilters | ( | ) |
Returns an array of filters currently applied.
Implements Assetic\Asset\AssetInterface.
Definition at line 68 of file BaseAsset.php.
Assetic\Asset\BaseAsset::getSourceDirectory | ( | ) |
Returns the asset's source directory.
The source directory is the directory the asset was located in and can be used to resolve references relative to an asset.
Implements Assetic\Asset\AssetInterface.
Definition at line 137 of file BaseAsset.php.
References Assetic\Asset\BaseAsset\$sourceDir.
Assetic\Asset\BaseAsset::getSourcePath | ( | ) |
Returns the relative path for the source asset.
This value can be combined with the asset's source root (if both are non-null) to get something compatible with file_get_contents().
For example:
Implements Assetic\Asset\AssetInterface.
Definition at line 132 of file BaseAsset.php.
References Assetic\Asset\BaseAsset\$sourcePath.
Assetic\Asset\BaseAsset::getSourceRoot | ( | ) |
Returns an absolute path or URL to the source asset's root directory.
This value should be an absolute path to a directory in the filesystem, an absolute URL with no path, or null.
For example:
Implements Assetic\Asset\AssetInterface.
Definition at line 127 of file BaseAsset.php.
References Assetic\Asset\BaseAsset\$sourceRoot.
Assetic\Asset\BaseAsset::getTargetPath | ( | ) |
Returns the URL for the current asset.
Implements Assetic\Asset\AssetInterface.
Definition at line 142 of file BaseAsset.php.
References Assetic\Asset\BaseAsset\$targetPath.
Assetic\Asset\BaseAsset::getValues | ( | ) |
Returns the current values for this asset.
Implements Assetic\Asset\AssetInterface.
Definition at line 177 of file BaseAsset.php.
References Assetic\Asset\BaseAsset\$values.
Referenced by Assetic\Asset\FileAsset\getLastModified(), Assetic\Asset\HttpAsset\load(), and Assetic\Asset\FileAsset\load().
Assetic\Asset\BaseAsset::getVars | ( | ) |
Returns an array of variable names for this asset.
Implements Assetic\Asset\AssetInterface.
Definition at line 160 of file BaseAsset.php.
References Assetic\Asset\BaseAsset\$vars.
Referenced by Assetic\Asset\FileAsset\getLastModified(), Assetic\Asset\HttpAsset\load(), and Assetic\Asset\FileAsset\load().
Assetic\Asset\BaseAsset::setContent | ( | $content | ) |
Sets the content of the current asset.
Filters can use this method to change the content of the asset.
string | $content | The asset content |
Implements Assetic\Asset\AssetInterface.
Definition at line 122 of file BaseAsset.php.
References Assetic\Asset\BaseAsset\$content.
Assetic\Asset\BaseAsset::setTargetPath | ( | $targetPath | ) |
Sets the URL for the current asset.
string | $targetPath | A web URL where the asset will be dumped |
Implements Assetic\Asset\AssetInterface.
Definition at line 147 of file BaseAsset.php.
References Assetic\Asset\BaseAsset\$targetPath.
Assetic\Asset\BaseAsset::setValues | ( | array | $values | ) |
Sets the values for the asset's variables.
array | $values |
Implements Assetic\Asset\AssetInterface.
Definition at line 165 of file BaseAsset.php.
References Assetic\Asset\BaseAsset\$values.
|
private |
Definition at line 32 of file BaseAsset.php.
Referenced by Assetic\Asset\StringAsset\__construct(), Assetic\Asset\BaseAsset\doLoad(), Assetic\Asset\BaseAsset\getContent(), Assetic\Asset\HttpAsset\load(), and Assetic\Asset\BaseAsset\setContent().
|
private |
Definition at line 27 of file BaseAsset.php.
Referenced by Assetic\Asset\BaseAsset\__clone(), Assetic\Asset\StringAsset\__construct(), Assetic\Asset\FileAsset\__construct(), Assetic\Asset\HttpAsset\__construct(), Assetic\Asset\BaseAsset\__construct(), Assetic\Asset\BaseAsset\doLoad(), and Assetic\Asset\BaseAsset\dump().
|
private |
Definition at line 33 of file BaseAsset.php.
|
private |
Definition at line 30 of file BaseAsset.php.
Referenced by Assetic\Asset\BaseAsset\getSourceDirectory().
|
private |
Definition at line 29 of file BaseAsset.php.
Referenced by Assetic\Asset\StringAsset\__construct(), Assetic\Asset\FileAsset\__construct(), Assetic\Asset\BaseAsset\__construct(), and Assetic\Asset\BaseAsset\getSourcePath().
|
private |
Definition at line 28 of file BaseAsset.php.
Referenced by Assetic\Asset\StringAsset\__construct(), Assetic\Asset\FileAsset\__construct(), Assetic\Asset\BaseAsset\__construct(), and Assetic\Asset\BaseAsset\getSourceRoot().
|
private |
Definition at line 31 of file BaseAsset.php.
Referenced by Assetic\Asset\BaseAsset\getTargetPath(), and Assetic\Asset\BaseAsset\setTargetPath().
|
private |
Definition at line 35 of file BaseAsset.php.
Referenced by Assetic\Asset\BaseAsset\getValues(), and Assetic\Asset\BaseAsset\setValues().
|
private |
Definition at line 34 of file BaseAsset.php.
Referenced by Assetic\Asset\FileAsset\__construct(), Assetic\Asset\HttpAsset\__construct(), Assetic\Asset\BaseAsset\__construct(), and Assetic\Asset\BaseAsset\getVars().