class ConfigProviderInstall in Configuration Provider 8
Same name and namespace in other branches
- 8.2 src/Plugin/ConfigProvider/ConfigProviderInstall.php \Drupal\config_provider\Plugin\ConfigProvider\ConfigProviderInstall
Class for providing configuration from an install directory.
Plugin annotation
@ConfigProvider(
id = \Drupal\config_provider\Plugin\ConfigProvider\ConfigProviderInstall::ID,
weight = -10,
label = @Translation("Install"),
description = @Translation("Configuration to be installed when an extension is installed."),
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\config_provider\Plugin\ConfigProviderBase implements ConfigProviderInterface
- class \Drupal\config_provider\Plugin\ConfigProvider\ConfigProviderInstall
- class \Drupal\config_provider\Plugin\ConfigProviderBase implements ConfigProviderInterface
Expanded class hierarchy of ConfigProviderInstall
File
- src/
Plugin/ ConfigProvider/ ConfigProviderInstall.php, line 20
Namespace
Drupal\config_provider\Plugin\ConfigProviderView source
class ConfigProviderInstall extends ConfigProviderBase {
/**
* The configuration provider ID.
*/
const ID = InstallStorage::CONFIG_INSTALL_DIRECTORY;
/**
* {@inheritdoc}
*/
public function addConfigToCreate(array &$config_to_create, StorageInterface $storage, $collection, $prefix = '', array $profile_storages = []) {
// The caller will aready have loaded config for install.
}
/**
* {@inheritdoc}
*/
public function addInstallableConfig(InMemoryStorage $installable_config, array $extensions = []) {
$storage = $this
->getExtensionInstallStorage(static::ID);
$config_names = $this
->listConfig($storage, $extensions);
$config_to_add = $storage
->readMultiple($config_names);
foreach ($config_to_add as $name => $data) {
$installable_config
->write($name, $data);
}
// Get all data from the remaining collections.
// Gather information about all the supported collections.
$collection_info = $this->configManager
->getConfigCollectionInfo();
foreach ($collection_info
->getCollectionNames() as $collection) {
$collection_storage = $storage
->createCollection($collection);
$config_names = $this
->listConfig($collection_storage, $extensions);
$config_to_add = $collection_storage
->readMultiple($config_names);
foreach ($config_to_add as $name => $data) {
$installable_config
->writeToCollection($name, $data, $collection);
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigProviderBase:: |
protected | property | The active configuration storages, keyed by collection. | |
ConfigProviderBase:: |
protected | property | The configuration factory. | |
ConfigProviderBase:: |
protected | property | The configuration manager. | |
ConfigProviderBase:: |
protected | function | Gets the configuration storage that provides the active configuration. | |
ConfigProviderBase:: |
public | function |
Returns the configuration directory. Overrides ConfigProviderInterface:: |
|
ConfigProviderBase:: |
protected | function | Gets the list of enabled extensions including both modules and themes. | |
ConfigProviderBase:: |
protected | function | Gets the storage for a designated configuration provider. | |
ConfigProviderBase:: |
protected | function | Returns a list of all configuration items or those of extensions. | |
ConfigProviderBase:: |
public | function |
Indicates whether the configuration items returned by the provider are
full as opposed to partials. Overrides ConfigProviderInterface:: |
|
ConfigProviderBase:: |
public | function |
Injects the active configuration storage. Overrides ConfigProviderInterface:: |
|
ConfigProviderBase:: |
public | function |
Injects the active configuration storage. Overrides ConfigProviderInterface:: |
|
ConfigProviderBase:: |
public | function |
Injects the active configuration storage. Overrides ConfigProviderInterface:: |
|
ConfigProviderBase:: |
protected | function | Validates an array of config data that contains dependency information. | |
ConfigProviderInstall:: |
public | function |
Adds configuration to be installed. Overrides ConfigProviderInterface:: |
|
ConfigProviderInstall:: |
public | function |
Adds configuration that is available to be installed or updated. Overrides ConfigProviderInterface:: |
|
ConfigProviderInstall:: |
constant | The configuration provider ID. | ||
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 92 |