StorageComparer
class StorageComparer implements StorageComparerInterface (View source)
Defines a config storage comparer.
Traits
Provides dependency injection friendly methods for serialization.
Properties
| protected array | $_serviceIds | An array of service IDs keyed by property name used for serialization. |
from DependencySerializationTrait |
| protected array | $_entityStorages | An array of entity type IDs keyed by the property name of their storages. |
from DependencySerializationTrait |
| protected StorageInterface | $sourceStorage | The source storage used to discover configuration changes. |
|
| protected StorageInterface[] | $sourceStorages | The source storages keyed by collection. |
|
| protected StorageInterface | $targetStorage | The target storage used to write configuration changes. |
|
| protected StorageInterface[] | $targetStorages | The target storages keyed by collection. |
|
| protected array | $changelist | List of changes to between the source storage and the target storage. |
|
| protected array | $sourceNames | Sorted list of all the configuration object names in the source storage. |
|
| protected array | $targetNames | Sorted list of all the configuration object names in the target storage. |
|
| protected MemoryBackend | $sourceCacheStorage | A memory cache backend to statically cache source configuration data. |
|
| protected MemoryBackend | $targetCacheStorage | A memory cache backend to statically cache target configuration data. |
Methods
Constructs the Configuration storage comparer.
Gets the configuration source storage.
Gets the configuration target storage.
Gets an empty changelist.
Gets the list of differences to import.
Adds changes to the changelist.
{@inheritdoc}
Creates the delete changelist.
Creates the create changelist.
Creates the update changelist.
Creates the rename changelist.
Removes the entry from the given operation changelist for the given name.
Moves a rename operation to an update.
Recalculates the differences.
Checks if there are any operations with changes to process.
Validates that the system.site::uuid in the source and target match.
Gets and sorts configuration data from the source and target storages.
Creates a rename name from the old and new names for the object.
Extracts old and new configuration names from a configuration change name.
Gets the existing collections from both the target and source storage.
Details
__sleep()
{@inheritdoc}
__wakeup()
{@inheritdoc}
__construct(StorageInterface $source_storage, StorageInterface $target_storage)
Constructs the Configuration storage comparer.
StorageInterface
getSourceStorage(string $collection = StorageInterface::DEFAULT_COLLECTION)
Gets the configuration source storage.
StorageInterface
getTargetStorage(string $collection = StorageInterface::DEFAULT_COLLECTION)
Gets the configuration target storage.
array
getEmptyChangelist()
Gets an empty changelist.
array
getChangelist(string $op = NULL, string $collection = StorageInterface::DEFAULT_COLLECTION)
Gets the list of differences to import.
protected
addChangeList(string $collection, string $op, array $changes, array $sort_order = NULL)
Adds changes to the changelist.
createChangelist()
{@inheritdoc}
protected
addChangelistDelete(string $collection)
Creates the delete changelist.
The list of deletes is sorted so that dependencies are deleted after configuration entities that depend on them. For example, fields should be deleted after field storages.
protected
addChangelistCreate(string $collection)
Creates the create changelist.
The list of creates is sorted so that dependencies are created before configuration entities that depend on them. For example, field storages should be created before fields.
protected
addChangelistUpdate(string $collection)
Creates the update changelist.
The list of updates is sorted so that dependencies are created before configuration entities that depend on them. For example, field storages should be updated before fields.
protected
addChangelistRename(string $collection)
Creates the rename changelist.
The list of renames is created from the different source and target names with same UUID. These changes will be removed from the create and delete lists.
protected
removeFromChangelist(string $collection, string $op, string $name)
Removes the entry from the given operation changelist for the given name.
moveRenameToUpdate(string $rename, string $collection = StorageInterface::DEFAULT_COLLECTION)
Moves a rename operation to an update.
$this
reset()
Recalculates the differences.
bool
hasChanges()
Checks if there are any operations with changes to process.
Until the changelist has been calculated this will always be FALSE.
bool
validateSiteUuid()
Validates that the system.site::uuid in the source and target match.
protected
getAndSortConfigData($collection)
Gets and sorts configuration data from the source and target storages.
protected string
createRenameName(string $old_name, string $new_name)
Creates a rename name from the old and new names for the object.
array
extractRenameNames(string $name)
Extracts old and new configuration names from a configuration change name.
array
getAllCollectionNames(bool $include_default = TRUE)
Gets the existing collections from both the target and source storage.