class NullStorage in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Config/NullStorage.php \Drupal\Core\Config\NullStorage
Defines a stub storage.
This storage is always empty; the controller reads and writes nothing.
The stub implementation is needed for synchronizing configuration during installation of a module, in which case all configuration being shipped with the module is known to be new. Therefore, the module installation process is able to short-circuit the full diff against the active configuration; the diff would yield all currently available configuration as items to remove, since they do not exist in the module's default configuration directory.
This also can be used for testing purposes.
Hierarchy
- class \Drupal\Core\Config\NullStorage implements StorageInterface
Expanded class hierarchy of NullStorage
1 file declares its use of NullStorage
- DrupalKernel.php in core/
lib/ Drupal/ Core/ DrupalKernel.php - Contains \Drupal\Core\DrupalKernel.
File
- core/
lib/ Drupal/ Core/ Config/ NullStorage.php, line 24 - Contains \Drupal\Core\Config\NullStorage.
Namespace
Drupal\Core\ConfigView source
class NullStorage implements StorageInterface {
/**
* {@inheritdoc}
*/
public function exists($name) {
return FALSE;
}
/**
* {@inheritdoc}
*/
public function read($name) {
return array();
}
/**
* {@inheritdoc}
*/
public function readMultiple(array $names) {
return array();
}
/**
* {@inheritdoc}
*/
public function write($name, array $data) {
return FALSE;
}
/**
* {@inheritdoc}
*/
public function delete($name) {
return FALSE;
}
/**
* {@inheritdoc}
*/
public function rename($name, $new_name) {
return FALSE;
}
/**
* {@inheritdoc}
*/
public function encode($data) {
return $data;
}
/**
* {@inheritdoc}
*/
public function decode($raw) {
return $raw;
}
/**
* {@inheritdoc}
*/
public function listAll($prefix = '') {
return array();
}
/**
* {@inheritdoc}
*/
public function deleteAll($prefix = '') {
return FALSE;
}
/**
* {@inheritdoc}
*/
public function createCollection($collection) {
// No op.
}
/**
* {@inheritdoc}
*/
public function getAllCollectionNames() {
return array();
}
/**
* {@inheritdoc}
*/
public function getCollectionName() {
return '';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
NullStorage:: |
public | function |
Creates a collection on the storage. Overrides StorageInterface:: |
|
NullStorage:: |
public | function |
Decodes configuration data from the storage-specific format. Overrides StorageInterface:: |
|
NullStorage:: |
public | function |
Deletes a configuration object from the storage. Overrides StorageInterface:: |
|
NullStorage:: |
public | function |
Deletes configuration objects whose names start with a given prefix. Overrides StorageInterface:: |
|
NullStorage:: |
public | function |
Encodes configuration data into the storage-specific format. Overrides StorageInterface:: |
|
NullStorage:: |
public | function |
Returns whether a configuration object exists. Overrides StorageInterface:: |
|
NullStorage:: |
public | function |
Gets the existing collections. Overrides StorageInterface:: |
|
NullStorage:: |
public | function |
Gets the name of the current collection the storage is using. Overrides StorageInterface:: |
|
NullStorage:: |
public | function |
Gets configuration object names starting with a given prefix. Overrides StorageInterface:: |
|
NullStorage:: |
public | function |
Reads configuration data from the storage. Overrides StorageInterface:: |
|
NullStorage:: |
public | function |
Reads configuration data from the storage. Overrides StorageInterface:: |
|
NullStorage:: |
public | function |
Renames a configuration object in the storage. Overrides StorageInterface:: |
|
NullStorage:: |
public | function |
Writes configuration data to the storage. Overrides StorageInterface:: |
|
StorageInterface:: |
constant | The default collection name. |