Method | Description | |
---|---|---|
__construct ( $paths, $prefix = '' ) | ||
__invoke ( $t, $m = null, $v = [], $f = false ) | Alias for {@link process()} | |
addDependency ( string $type, string $path ) | adds the $path to dependency list of $type using type-based dependencies to, for example, allow a css file to rely on a .png file | |
applyFilter ( string $content, string $filter, string $file, $dir, array $vars ) : string | apply a filter used for singletonization of filters | |
getCacheDirectory ( ) : string | ||
getCurrentInstance ( ) : |
singleton | |
getDependencies ( string $type ) : array | returns dependency list for the given $type | |
getDependenciesFileContent ( string $type ) : string | returns dependency list formatted for storing | |
getFilter ( string $name ) : string | fitler singleton | |
getLocator ( ) | ||
getMainFile ( string $type ) | returns the main file for a certain type proxies to the Locator | |
getManifestName ( ) | ||
getOption ( $name ) | fetches an option | |
getPrefix ( ) | ||
getRegisteredFiles ( string $type = null ) | auto-vivificates $this->registered_files (shouldn't be needed) | |
process ( string $type, string $manifest = null, array $vars = [], boolean $full = false ) : string | array | Runs the pipeline | |
registerFile ( $type, $from, $to ) | if we have multiple filters, the mapping will be overrided so that we know last file's name :). | |
registerFilter ( string $ext, string $class ) | registers a special extension the class must be an instance of \Sprockets\Filter\Base | |
setOptions ( array $options ) | set options (destructively) or defaults |
Method | Description | |
---|---|---|
getFilterClass ( $name ) | finds filter class |
public __invoke ( $t, $m = null, $v = [], $f = false ) |
public addDependency ( string $type, string $path ) | ||
$type | string | dependency type (application.$type) |
$path | string | file path (x.png, for example) |
public getCacheDirectory ( ) : string | ||
return | string | the cache directory used by Sprockets |
public static getCurrentInstance ( ) : |
||
return | current pipeline instance |
public getDependencies ( string $type ) : array | ||
$type | string | dependency type (application.$type) |
return | array | files dependent for the type |
public getDependenciesFileContent ( string $type ) : string | ||
$type | string | dependency type (application.$type) |
return | string | file formatted "path:mtime\npath:..." |
public getMainFile ( string $type ) | ||
$type | string | asset type |
public getRegisteredFiles ( string $type = null ) | ||
$type | string | file type or null for the whole array |
public process ( string $type, string $manifest = null, array $vars = [], boolean $full = false ) : string | array | ||
$type | string | asset type |
$manifest | string | main file, "application.$type" by default |
$vars | array | context for the pipeline (vars you pass to templates) |
$full | boolean | True if you want an array containing file list and content |
return | string | array | string unless $full |
public registerFile ( $type, $from, $to ) |
public registerFilter ( string $ext, string $class ) | ||
$ext | string | Extension |
$class | string | Filter class |
public setOptions ( array $options ) | ||
$options | array |