PHP Class Hostnet\Component\Webpack\Asset\Tracker

Author: Harold Iedema ([email protected])
Exibir arquivo Open project: hostnet/webpack-bundle Class Usage Examples

Public Methods

Method Description
__construct ( Hostnet\Component\Webpack\Profiler\Profiler $profiler, Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinderInterface $finder, string $root_dir, string $asset_dir, string $output_dir, array $bundle_paths = [] ) Create new Tracker.
addPath ( string $path ) : Tracker Add a path to the list of tracked paths (this can be both dir's or files).
getAliases ( ) : array Get the tracked aliases
getTemplates ( ) : string[] Returns a list of twig templates that are being tracked.
isOutdated ( ) : boolean Returns true if the cache is outdated.
resolveResourcePath ( string $path ) : string Find the full path to a requested resource, this can be bundle configurations like @BundleName/resource.twig

Private Methods

Method Description
addTemplate ( Symfony\Component\Templating\TemplateReferenceInterface $reference ) : Tracker Adds twig templates to the tracker.
boot ( ) Runtime initialize this tracker.
resolvePath ( string $path ) : string Find the full path to a requested path, this can be bundle configurations like @BundleName/

Method Details

__construct() public method

Create new Tracker.
public __construct ( Hostnet\Component\Webpack\Profiler\Profiler $profiler, Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinderInterface $finder, string $root_dir, string $asset_dir, string $output_dir, array $bundle_paths = [] )
$profiler Hostnet\Component\Webpack\Profiler\Profiler key-value store used to present 'logging' in the symfony-profiler bar.
$finder Symfony\Bundle\FrameworkBundle\CacheWarmer\TemplateFinderInterface used to find all the templates which needs to be tracked.
$root_dir string '%kernel.root_dir%' root directory of the application.
$asset_dir string directory to resolve assets, directory is resolved relative from the bundle path.
$output_dir string The directory where the compiled resources are stored.
$bundle_paths array the optional associative mapping between bundle names and their absolute paths.

addPath() public method

Add a path to the list of tracked paths (this can be both dir's or files).
public addPath ( string $path ) : Tracker
$path string the path to track.
return Tracker this instance.

getAliases() public method

Get the tracked aliases
public getAliases ( ) : array
return array the tracked aliases.

getTemplates() public method

Returns a list of twig templates that are being tracked.
public getTemplates ( ) : string[]
return string[] list of twig templates.

isOutdated() public method

Returns true if the cache is outdated.
public isOutdated ( ) : boolean
return boolean true, cache is outdated of non exsitant.

resolveResourcePath() public method

Find the full path to a requested resource, this can be bundle configurations like @BundleName/resource.twig
public resolveResourcePath ( string $path ) : string
$path string the path resolve
return string the full path to the requested resource or false if not found.