/** * {@inheritdoc} */ function listConfig($list_type, $name) { $active_list = array(); $install_list = array(); $optional_list = array(); $definitions = $this->listTypes(); switch ($list_type) { case 'type': if ($name == 'system.all') { $active_list = $this->activeConfigStorage->listAll(); $install_list = $this->extensionConfigStorage->listAll(); $optional_list = $this->extensionOptionalConfigStorage->listAll(); } elseif ($name == 'system.simple') { // Listing is done by prefixes, and simple config doesn't have one. // So list all and filter out all known prefixes. $active_list = $this->omitKnownPrefixes($this->activeConfigStorage->listAll()); $install_list = $this->omitKnownPrefixes($this->extensionConfigStorage->listAll()); $optional_list = $this->omitKnownPrefixes($this->extensionOptionalConfigStorage->listAll()); } elseif (isset($this->definitions[$name])) { $definition = $this->definitions[$name]; $prefix = $definition->getConfigPrefix(); $active_list = $this->activeConfigStorage->listAll($prefix); $install_list = $this->extensionConfigStorage->listAll($prefix); $optional_list = $this->extensionOptionalConfigStorage->listAll($prefix); } break; case 'profile': $name = Settings::get('install_profile'); // Intentional fall-through here to the 'module' or 'theme' case. // Intentional fall-through here to the 'module' or 'theme' case. case 'module': case 'theme': $active_list = $this->activeConfigStorage->listAll(); $install_list = $this->listProvidedItems($list_type, $name); $optional_list = $this->listProvidedItems($list_type, $name, TRUE); break; } return array($active_list, $install_list, $optional_list); }
/** * {@inheritdoc} */ public function installCollectionDefaultConfig($collection) { $storage = new ExtensionInstallStorage($this->getActiveStorages(StorageInterface::DEFAULT_COLLECTION), InstallStorage::CONFIG_INSTALL_DIRECTORY, $collection, $this->drupalInstallationAttempted()); // Only install configuration for enabled extensions. $enabled_extensions = $this->getEnabledExtensions(); $config_to_install = array_filter($storage->listAll(), function ($config_name) use($enabled_extensions) { $provider = Unicode::substr($config_name, 0, strpos($config_name, '.')); return in_array($provider, $enabled_extensions); }); if (!empty($config_to_install)) { $this->createConfiguration($collection, $storage->readMultiple($config_to_install)); // Reset all the static caches and list caches. $this->configFactory->reset(); } }