/** * Get the AssetCompress factory based on the config object. * * @return \AssetCompress\Factory */ protected function factory() { if (empty($this->factory)) { $this->config->theme($this->theme); $this->factory = new Factory($this->config); } return $this->factory; }
/** * clear the builds for a specific extension. * * @return void */ protected function _clearBuilds() { $themes = (array) $this->config->general('themes'); if ($themes) { $this->config->theme($themes[0]); } $assets = $this->factory->assetCollection(); if (count($assets) === 0) { $this->err('No build targets defined, skipping'); return; } $targets = array_map(function ($target) { return $target->name(); }, iterator_to_array($assets)); $this->_clearPath(CACHE . 'asset_compress' . DS, $themes, $targets); $this->_clearPath($this->config->cachePath('js'), $themes, $targets); $this->_clearPath($this->config->cachePath('css'), $themes, $targets); }
/** * Create a new scanner instance for the provided paths. * * @param array $paths The paths to scan. * @return \MiniAsset\AssetScanner */ public function scanner($paths) { return new AssetScanner($paths, $this->config->theme()); }