class DecoratingConfigInstaller in Configuration selector 8.2
Same name and namespace in other branches
- 8 src/DecoratingConfigInstaller.php \Drupal\config_selector\DecoratingConfigInstaller
Decorates the config.installer service so install_install_profiles() works.
The install step that installs installation profiles calls the config installer directly which results in the Configuration Selector not being able to select configuration.
Hierarchy
- class \Drupal\config_selector\DecoratingConfigInstaller implements ConfigInstallerInterface
Expanded class hierarchy of DecoratingConfigInstaller
File
- src/
DecoratingConfigInstaller.php, line 15
Namespace
Drupal\config_selectorView source
class DecoratingConfigInstaller implements ConfigInstallerInterface {
/**
* The config.installer service.
*
* @var \Drupal\Core\Config\ConfigInstallerInterface
*/
protected $decoratedService;
/**
* DecoratingConfigInstaller constructor.
*
* @param \Drupal\Core\Config\ConfigInstallerInterface $config_installer
* The config.installer service to decorate.
* @param \Drupal\config_selector\ConfigSelector $config_selector
* The config_selector service.
*/
public function __construct(ConfigInstallerInterface $config_installer, ConfigSelector $config_selector) {
$this->decoratedService = $config_installer;
$this->configSelector = $config_selector;
}
/**
* {@inheritdoc}
*/
public function installDefaultConfig($type, $name) {
$this->decoratedService
->installDefaultConfig($type, $name);
}
/**
* {@inheritdoc}
*/
public function installOptionalConfig(StorageInterface $storage = NULL, $dependency = []) {
$this->decoratedService
->installOptionalConfig($storage, $dependency);
if ($storage === NULL && empty($dependency)) {
// This is not called as part of a regular module install. It's called
// install_install_profile(). This means that
// \Drupal\config_selector\ConfigSelector::$modulePreinstallTriggered will
// be NULL and therefore this will proceed to check all the configuration.
$this->configSelector
->selectConfigOnInstall([]);
}
}
/**
* {@inheritdoc}
*/
public function installCollectionDefaultConfig($collection) {
$this->decoratedService
->installCollectionDefaultConfig($collection);
}
/**
* {@inheritdoc}
*/
public function setSourceStorage(StorageInterface $storage) {
$this->decoratedService
->setSourceStorage($storage);
return $this;
}
/**
* Gets the configuration storage that provides the default configuration.
*
* @return \Drupal\Core\Config\StorageInterface|null
* The configuration storage that provides the default configuration.
* Returns null if the source storage has not been set.
*/
public function getSourceStorage() {
return $this->decoratedService
->getSourceStorage();
}
/**
* {@inheritdoc}
*/
public function setSyncing($status) {
$this->decoratedService
->setSyncing($status);
return $this;
}
/**
* {@inheritdoc}
*/
public function isSyncing() {
return $this->decoratedService
->isSyncing();
}
/**
* {@inheritdoc}
*/
public function checkConfigurationToInstall($type, $name) {
$this->decoratedService
->checkConfigurationToInstall($type, $name);
}
}