3 namespace Drupal\Core\Installer;
5 use Drupal\Core\Cache\CacheableMetadata;
6 use Drupal\Core\Config\ConfigFactoryOverrideInterface;
7 use Drupal\Core\Config\StorageInterface;
8 use Drupal\Core\DependencyInjection\ContainerBuilder;
9 use Drupal\Core\DependencyInjection\ServiceProviderInterface;
12 * Override configuration during the installer.
14 class ConfigOverride implements ServiceProviderInterface, ConfigFactoryOverrideInterface {
19 public function register(ContainerBuilder $container) {
20 // Register this class so that it can override configuration.
22 ->register('core.install_config_override', static::class)
23 ->addTag('config.factory.override');
29 public function loadOverrides($names) {
31 if (drupal_installation_attempted() && function_exists('drupal_install_profile_distribution_name')) {
32 // Early in the installer the site name is unknown. In this case we need
33 // to fallback to the distribution's name.
34 $overrides['system.site'] = [
35 'name' => drupal_install_profile_distribution_name(),
44 public function getCacheSuffix() {
45 return 'core.install_config_override';
51 public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
58 public function getCacheableMetadata($name) {
59 return new CacheableMetadata();