public function StorageComparer::__construct

public StorageComparer::__construct(StorageInterface $source_storage, StorageInterface $target_storage, ConfigManagerInterface $config_manager)

Constructs the Configuration storage comparer.

Parameters

\Drupal\Core\Config\StorageInterface $source_storage: Storage object used to read configuration.

\Drupal\Core\Config\StorageInterface $target_storage: Storage object used to write configuration.

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

File

core/lib/Drupal/Core/Config/StorageComparer.php, line 101

Class

StorageComparer
Defines a config storage comparer.

Namespace

Drupal\Core\Config

Code

public function __construct(StorageInterface $source_storage, StorageInterface $target_storage, ConfigManagerInterface $config_manager) {
  // Wrap the storages in a static cache so that multiple reads of the same
  // raw configuration object are not costly.
  $this->sourceCacheStorage = new MemoryBackend(__CLASS__ . '::source');
  $this->sourceStorage = new CachedStorage(
  $source_storage, 
  $this->sourceCacheStorage
  );
  $this->targetCacheStorage = new MemoryBackend(__CLASS__ . '::target');
  $this->targetStorage = new CachedStorage(
  $target_storage, 
  $this->targetCacheStorage
  );
  $this->configManager = $config_manager;
  $this->changelist[StorageInterface::DEFAULT_COLLECTION] = $this->getEmptyChangelist();
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Config!StorageComparer.php/function/StorageComparer::__construct/8.1.x