function ConfigInstallerInterface::installOptionalConfig

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Config/ConfigInstallerInterface.php \Drupal\Core\Config\ConfigInstallerInterface::installOptionalConfig()
  2. 10 core/lib/Drupal/Core/Config/ConfigInstallerInterface.php \Drupal\Core\Config\ConfigInstallerInterface::installOptionalConfig()
  3. 9 core/lib/Drupal/Core/Config/ConfigInstallerInterface.php \Drupal\Core\Config\ConfigInstallerInterface::installOptionalConfig()
  4. 8.9.x core/lib/Drupal/Core/Config/ConfigInstallerInterface.php \Drupal\Core\Config\ConfigInstallerInterface::installOptionalConfig()

Installs optional configuration.

Optional configuration is only installed if:

  • the configuration does not exist already.
  • it's a configuration entity.
  • its dependencies can be met.

Parameters

\Drupal\Core\Config\StorageInterface|null $storage: (optional) The configuration storage to search for optional configuration. If not provided, all enabled extension's optional configuration directories including the install profile's will be searched.

array $dependency: (optional) If set, ensures that the configuration being installed has this dependency. The format is dependency type as the key ('module', 'theme', or 'config') and the dependency name as the value ('node', 'my_theme', 'views.view.promoted_content').

1 method overrides ConfigInstallerInterface::installOptionalConfig()
ConfigInstaller::installOptionalConfig in core/lib/Drupal/Core/Config/ConfigInstaller.php
Installs optional configuration.

File

core/lib/Drupal/Core/Config/ConfigInstallerInterface.php, line 59

Class

ConfigInstallerInterface
Interface for classes that install config.

Namespace

Drupal\Core\Config

Code

public function installOptionalConfig(?StorageInterface $storage = NULL, $dependency = []);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.