public function StorageComparer::__construct in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Config/StorageComparer.php \Drupal\Core\Config\StorageComparer::__construct()
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.
File
- core/
lib/ Drupal/ Core/ Config/ StorageComparer.php, line 92
Class
- StorageComparer
- Defines a config storage comparer.
Namespace
Drupal\Core\ConfigCode
public function __construct(StorageInterface $source_storage, StorageInterface $target_storage) {
// Wrap the storages in a static cache so that multiple reads of the same
// raw configuration object are not costly.
$this->sourceCacheStorage = new MemoryBackend();
$this->sourceStorage = new CachedStorage($source_storage, $this->sourceCacheStorage);
$this->targetCacheStorage = new MemoryBackend();
$this->targetStorage = new CachedStorage($target_storage, $this->targetCacheStorage);
$this->changelist[StorageInterface::DEFAULT_COLLECTION] = $this
->getEmptyChangelist();
}