class SourceStorage in Configuration installer 8
Wraps the sync storage so the config_installer can make modifications.
Hierarchy
- class \Drupal\config_installer\Storage\SourceStorage implements StorageInterface uses DependencySerializationTrait
Expanded class hierarchy of SourceStorage
2 files declare their use of SourceStorage
- config_installer.profile in ./
config_installer.profile - Enables modules and site configuration for a minimal site installation.
- SyncConfigureForm.php in src/
Form/ SyncConfigureForm.php
File
- src/
Storage/ SourceStorage.php, line 11
Namespace
Drupal\config_installer\StorageView source
class SourceStorage implements StorageInterface {
use DependencySerializationTrait;
/**
* The configuration storage to wrap.
*
* @var \Drupal\Core\Config\StorageInterface
*/
protected $baseStorage;
/**
* The available install profiles.
*
* @var array
*/
protected $profiles;
/**
* Constructs a SourceStorage object.
*
* @param \Drupal\Core\Config\StorageInterface $base_storage
* The configuration storage to wrap.
* @param array $profiles
* The available install profiles.
*/
public function __construct(StorageInterface $base_storage, array $profiles) {
$this->baseStorage = $base_storage;
$this->profiles = $profiles;
}
/**
* {@inheritdoc}
*/
public function exists($name) {
return $this->baseStorage
->exists($name);
}
/**
* {@inheritdoc}
*/
public function read($name) {
$data = $this->baseStorage
->read($name);
if ($name === 'core.extension' && isset($data['module'])) {
// Remove any profiles from the list. These will be installed later.
// @see config_installer_config_import_profile()
$data['module'] = array_diff_key($data['module'], $this->profiles);
}
return $data;
}
/**
* {@inheritdoc}
*/
public function readMultiple(array $names) {
$list = [];
foreach ($names as $name) {
if ($data = $this
->read($name)) {
$list[$name] = $data;
}
}
return $list;
}
/**
* {@inheritdoc}
*/
public function write($name, array $data) {
return $this->baseStorage
->write($name, $data);
}
/**
* {@inheritdoc}
*/
public function delete($name) {
return $this->baseStorage
->delete($name);
}
/**
* {@inheritdoc}
*/
public function rename($name, $new_name) {
return $this->baseStorage
->rename($name, $new_name);
}
/**
* {@inheritdoc}
*/
public function encode($data) {
return $this->baseStorage
->encode($data);
}
/**
* {@inheritdoc}
*/
public function decode($raw) {
return $this->baseStorage
->decode($raw);
}
/**
* {@inheritdoc}
*/
public function listAll($prefix = '') {
return $this->baseStorage
->listAll($prefix);
}
/**
* {@inheritdoc}
*/
public function deleteAll($prefix = '') {
return $this->baseStorage
->deleteAll($prefix);
}
/**
* {@inheritdoc}
*/
public function createCollection($collection) {
return new static($this->baseStorage
->createCollection($collection), $this->profiles);
}
/**
* {@inheritdoc}
*/
public function getAllCollectionNames() {
return $this->baseStorage
->getAllCollectionNames();
}
/**
* {@inheritdoc}
*/
public function getCollectionName() {
return $this->baseStorage
->getCollectionName();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
SourceStorage:: |
protected | property | The configuration storage to wrap. | |
SourceStorage:: |
protected | property | The available install profiles. | |
SourceStorage:: |
public | function |
Creates a collection on the storage. Overrides StorageInterface:: |
|
SourceStorage:: |
public | function |
Decodes configuration data from the storage-specific format. Overrides StorageInterface:: |
|
SourceStorage:: |
public | function |
Deletes a configuration object from the storage. Overrides StorageInterface:: |
|
SourceStorage:: |
public | function |
Deletes configuration objects whose names start with a given prefix. Overrides StorageInterface:: |
|
SourceStorage:: |
public | function |
Encodes configuration data into the storage-specific format. Overrides StorageInterface:: |
|
SourceStorage:: |
public | function |
Returns whether a configuration object exists. Overrides StorageInterface:: |
|
SourceStorage:: |
public | function |
Gets the existing collections. Overrides StorageInterface:: |
|
SourceStorage:: |
public | function |
Gets the name of the current collection the storage is using. Overrides StorageInterface:: |
|
SourceStorage:: |
public | function |
Gets configuration object names starting with a given prefix. Overrides StorageInterface:: |
|
SourceStorage:: |
public | function |
Reads configuration data from the storage. Overrides StorageInterface:: |
|
SourceStorage:: |
public | function |
Reads configuration data from the storage. Overrides StorageInterface:: |
|
SourceStorage:: |
public | function |
Renames a configuration object in the storage. Overrides StorageInterface:: |
|
SourceStorage:: |
public | function |
Writes configuration data to the storage. Overrides StorageInterface:: |
|
SourceStorage:: |
public | function | Constructs a SourceStorage object. | |
StorageInterface:: |
constant | The default collection name. |