SettableStorageComparer.php in Configuration Synchronizer 8.2
File
src/Config/SettableStorageComparer.php
View source
<?php
namespace Drupal\config_sync\Config;
use Drupal\Core\Cache\MemoryBackend;
use Drupal\Core\Config\CachedStorage;
use Drupal\Core\Config\StorageComparer;
use Drupal\Core\Config\StorageInterface;
class SettableStorageComparer extends StorageComparer {
public function setSourceStorage(StorageInterface $storage) {
$this->sourceCacheStorage
->deleteAll();
$this->sourceNames = [];
$this->sourceStorage = new CachedStorage($storage, $this->sourceCacheStorage);
$this->changelist = [
StorageInterface::DEFAULT_COLLECTION => $this
->getEmptyChangelist(),
];
return $this;
}
public function setTargetStorage(StorageInterface $storage) {
$this->targetCacheStorage
->deleteAll();
$this->targetNames = [];
$this->targetStorage = new CachedStorage($storage, $this->targetCacheStorage);
$this->changelist = [
StorageInterface::DEFAULT_COLLECTION => $this
->getEmptyChangelist(),
];
return $this;
}
}