ImportStorageTransformer
final class ImportStorageTransformer (View source)
The import storage transformer helps to use the configuration management api.
This service does not implement an interface and is final because it is not meant to be replaced, extended or used in a different context. Its single purpose is to transform a storage for the import step of a configuration synchronization by dispatching the import transformation event.
Traits
Utility trait to copy configuration from one storage to another.
Constants
| LOCK_NAME |
The name used to identify the lock. |
Properties
| protected EventDispatcherInterface | $eventDispatcher | The event dispatcher to get changes to the configuration. |
|
| protected Connection | $connection | The drupal database connection. |
|
| protected LockBackendInterface | $requestLock | The normal lock for the duration of the request. |
|
| protected LockBackendInterface | $persistentLock | The persistent lock which the config importer uses across requests. |
Methods
Copy the configuration from one storage to another and remove stale items.
ImportStorageTransformer constructor.
Details
static protected
replaceStorageContents(StorageInterface $source, StorageInterface $target)
Copy the configuration from one storage to another and remove stale items.
This method empties target storage and copies all collections from source. Configuration is only copied and not imported, should not be used with the active storage as the target.
__construct(EventDispatcherInterface $event_dispatcher, Connection $connection, LockBackendInterface $requestLock, LockBackendInterface $persistentLock)
ImportStorageTransformer constructor.
StorageInterface
transform(StorageInterface $storage)
Transform the storage to be imported from.
An import transformation is done before the config importer uses the storage to synchronize the configuration. The transformation is also done for displaying differences to review imports. Importing in this context means the active drupal configuration is changed with the ConfigImporter which may or may not be as part of the config synchronization.