function ExtensionInstallStorage::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/ExtensionInstallStorage.php \Drupal\Core\Config\ExtensionInstallStorage::__construct()
  2. 10 core/lib/Drupal/Core/Config/ExtensionInstallStorage.php \Drupal\Core\Config\ExtensionInstallStorage::__construct()
  3. 11.x core/lib/Drupal/Core/Config/ExtensionInstallStorage.php \Drupal\Core\Config\ExtensionInstallStorage::__construct()

Overrides \Drupal\Core\Config\InstallStorage::__construct().

Parameters

\Drupal\Core\Config\StorageInterface $config_storage: The active configuration store where the list of enabled modules and themes is stored.

string $directory: The directory to scan in each extension to scan for files. Defaults to 'config/install'. This parameter will be mandatory in Drupal 9.0.0.

string $collection: (optional) The collection to store configuration in. Defaults to the default collection. This parameter will be mandatory in Drupal 9.0.0.

bool $include_profile: (optional) Whether to include the install profile in extensions to search and to get overrides from. This parameter will be mandatory in Drupal 9.0.0.

string|null $profile: (optional) The current installation profile. This parameter will be mandatory in Drupal 9.0.0.

Overrides InstallStorage::__construct

File

core/lib/Drupal/Core/Config/ExtensionInstallStorage.php, line 58

Class

ExtensionInstallStorage
Storage to access configuration and schema in enabled extensions.

Namespace

Drupal\Core\Config

Code

public function __construct(StorageInterface $config_storage, $directory = self::CONFIG_INSTALL_DIRECTORY, $collection = StorageInterface::DEFAULT_COLLECTION, $include_profile = TRUE, $profile = NULL) {
    parent::__construct($directory, $collection);
    $this->configStorage = $config_storage;
    $this->includeProfile = $include_profile;
    if (!isset($profile) && count(func_get_args()) < 5) {
        $profile = \Drupal::installProfile();
        @trigger_error('All \\Drupal\\Core\\Config\\ExtensionInstallStorage::__construct() arguments will be required in drupal:9.0.0. See https://www.drupal.org/node/2538996', E_USER_DEPRECATED);
    }
    $this->installProfile = $profile;
}

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