// Acquire a lock to ensure that the storage is not changed when a
// concurrent request tries to transform the storage. The lock will be
// released at the end of the request.
if (!
$this->requestLock->
acquire(self::LOCK_NAME
)) { $this->requestLock->
wait(self::LOCK_NAME
);
if (!
$this->requestLock->
acquire(self::LOCK_NAME
)) { throw new StorageTransformerException("Cannot acquire config import transformer lock."
);
} } // Copy the sync configuration to the created mutable storage.
self::
replaceStorageContents($storage,
$mutable);
// Dispatch the event so that event listeners can alter the configuration.
$this->eventDispatcher->
dispatch(new StorageTransformEvent($mutable), ConfigEvents::STORAGE_TRANSFORM_IMPORT
);
// Return the storage with the altered configuration.
return $mutable;
}}