You are here

public function Files::__construct in Advanced CSS/JS Aggregation 8.2

Constructs the State object.

Parameters

\Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_factory: The key value store to use.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: A config factory for retrieving required config objects.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Drupal\Core\Asset\AssetDumperInterface $asset_dumper: The dumper for optimized CSS assets.

\Drupal\Core\Cache\CacheBackendInterface $cache: The cache backend.

\Drupal\Core\Lock\LockBackendInterface $lock: The lock backend.

Overrides State::__construct

File

src/State/Files.php, line 62
Given a filename calculate various hashes and gather meta data.

Class

Files
Provides AdvAgg with a file status state system using a key value store.

Namespace

Drupal\advagg\State

Code

public function __construct(KeyValueFactoryInterface $key_value_factory, ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, AssetDumperInterface $asset_dumper, CacheBackendInterface $cache, LockBackendInterface $lock) {
  parent::__construct($key_value_factory, $cache, $lock);
  $this->keyValueStore = $key_value_factory
    ->get('advagg_files');
  $this->config = $config_factory
    ->get('advagg.settings');
  $this->moduleHandler = $module_handler;
  $this->dumper = $asset_dumper;
  $this->partsPath = $this->dumper
    ->preparePath('css') . 'parts/';
  file_prepare_directory($this->partsPath, FILE_CREATE_DIRECTORY);
}