PHP Class MiniAsset\Factory

This class can make AssetCollections and FilterCollections based on the configuration object passed to it.
Show file Open project: markstory/mini-asset Class Usage Examples

Protected Properties

Property Type Description
$config AssetConfig The config instance to make objects based on.

Public Methods

Method Description
__construct ( AssetConfig $config ) Constructor
assetCollection ( ) : AssetCollection Create an AssetCollection with all the configured assets.
cachedCompiler ( string $outputDir = '', boolean $debug = false ) : CachedCompiler Create a Caching Compiler
cacher ( string $path = '' ) : MiniAsset\AssetCacher Create an AssetCacher
compiler ( boolean $debug = false ) : Compiler Create an Compiler
filterRegistry ( ) : FilterRegistry Create a filter registry containing all the configured filters.
scanner ( array $paths ) : AssetScanner Create a new scanner instance for the provided paths.
target ( string $name ) : AssetTarget Create a single build target
writer ( string $tmpPath = '' ) : MiniAsset\AssetWriter Create an AssetWriter

Protected Methods

Method Description
buildFilter ( string $name, array $config ) : MiniAsset\Filter\AssetFilterInterface Create a single filter

Method Details

__construct() public method

Constructor
public __construct ( AssetConfig $config )
$config AssetConfig

assetCollection() public method

Create an AssetCollection with all the configured assets.
public assetCollection ( ) : AssetCollection
return AssetCollection

buildFilter() protected method

Create a single filter
protected buildFilter ( string $name, array $config ) : MiniAsset\Filter\AssetFilterInterface
$name string The name of the filter to build.
$config array The configuration for the filter.
return MiniAsset\Filter\AssetFilterInterface

cachedCompiler() public method

Create a Caching Compiler
public cachedCompiler ( string $outputDir = '', boolean $debug = false ) : CachedCompiler
$outputDir string The directory to output cached files to.
$debug boolean Whether or not to enable debugging mode for the compiler.
return MiniAsset\Output\CachedCompiler

cacher() public method

Create an AssetCacher
public cacher ( string $path = '' ) : MiniAsset\AssetCacher
$path string The path to cache assets into.
return MiniAsset\AssetCacher

compiler() public method

Create an Compiler
public compiler ( boolean $debug = false ) : Compiler
$debug boolean Whether or not to enable debugging mode for the compiler.
return MiniAsset\Output\Compiler

filterRegistry() public method

Create a filter registry containing all the configured filters.
public filterRegistry ( ) : FilterRegistry
return MiniAsset\Filter\FilterRegistry

scanner() public method

Create a new scanner instance for the provided paths.
public scanner ( array $paths ) : AssetScanner
$paths array The paths to scan.
return AssetScanner

target() public method

Create a single build target
public target ( string $name ) : AssetTarget
$name string The name of the target to build
return AssetTarget

writer() public method

Create an AssetWriter
public writer ( string $tmpPath = '' ) : MiniAsset\AssetWriter
$tmpPath string The path where the build timestamp lookup should be stored.
return MiniAsset\AssetWriter

Property Details

$config protected property

The config instance to make objects based on.
protected AssetConfig,MiniAsset $config
return AssetConfig