/** * @param array $configuration * @return Factory\AssetFactory */ public function createAssetFactory(array $configuration) { $factory = new Factory\AssetFactory($configuration['root_path']); $factory->setAssetManager($this->getAssetManager()); $factory->setFilterManager($this->getFilterManager()); // Cache buster should be add only if cache is enabled and if is available. if ($this->configuration->getCacheEnabled()) { $worker = $this->getCacheBusterStrategy(); if ($worker instanceof WorkerInterface) { $factory->addWorker($worker); } } $factory->setDebug($this->configuration->isDebug()); return $factory; }
private function cacheAsset(AssetInterface $asset) { return $this->configuration->getCacheEnabled() ? new AssetCache($asset, new FilesystemCache($this->configuration->getCachePath())) : $asset; }
public function testSetCacheEnabled() { $expected = true; $this->assertNull($this->object->setCacheEnabled($expected)); $this->assertEquals($expected, $this->object->getCacheEnabled()); }