You are here

public function ConfigSyncLister::__construct in Configuration Synchronizer 8.2

Same name and namespace in other branches
  1. 8 src/ConfigSyncLister.php \Drupal\config_sync\ConfigSyncLister::__construct()

Constructs a ConfigSyncLister object.

Parameters

\Drupal\config_sync\Plugin\SyncConfigCollectorInterface $config_collector: The config collector.

\Drupal\config_update\ConfigListInterface $config_update_lister: The configuration update lister.

\Drupal\config_normalizer\Plugin\ConfigNormalizerManager $normalizer_manager: The normalizer plugin manager.

\Drupal\Core\Config\StorageInterface $active_storage: The active storage.

\Drupal\Core\Config\StorageInterface $provider_storage: The provider configuration storage.

\Drupal\Core\Config\ConfigManagerInterface $config_manager: The configuration manager.

\Drupal\Core\State\StateInterface $state: The state storage object.

File

src/ConfigSyncLister.php, line 102

Class

ConfigSyncLister
Provides methods related to listing configuration changes.

Namespace

Drupal\config_sync

Code

public function __construct(SyncConfigCollectorInterface $config_collector, ConfigUpdateListerInterface $config_update_lister, ConfigNormalizerManager $normalizer_manager, StorageInterface $active_storage, StorageInterface $provider_storage, ConfigManagerInterface $config_manager, StateInterface $state) {
  $this->configCollector = $config_collector;
  $this->configUpdateLister = $config_update_lister;
  $this
    ->setNormalizerManager($normalizer_manager);
  $this->activeStorages[$active_storage
    ->getCollectionName()] = $active_storage;
  $this->providerStorage = $provider_storage;
  $this
    ->setConfigManager($config_manager);
  $this->state = $state;
  $this->normalizedActiveStorage = new NormalizedReadOnlyStorage($active_storage, $normalizer_manager);

  // Set up a storage comparer to be used by each extension. Use a null
  // storage as a placeholder that we'll reset. Using a single storage
  // comparer rather than one per extension provides important optimization
  // since each storage comparer will load all records into a memory cache
  // and by setting a single source we can limit this to a single read.
  $this->activeStorageComparer = new SettableStorageComparer(new NormalizedReadOnlyStorage(new NullStorage(), $normalizer_manager), $this->normalizedActiveStorage, $config_manager);
}