X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FInstaller%2FConfigOverride.php;fp=web%2Fcore%2Flib%2FDrupal%2FCore%2FInstaller%2FConfigOverride.php;h=ff8d068b2fec360582815ad675a8e3457126098d;hp=0000000000000000000000000000000000000000;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/lib/Drupal/Core/Installer/ConfigOverride.php b/web/core/lib/Drupal/Core/Installer/ConfigOverride.php new file mode 100644 index 000000000..ff8d068b2 --- /dev/null +++ b/web/core/lib/Drupal/Core/Installer/ConfigOverride.php @@ -0,0 +1,62 @@ +register('core.install_config_override', static::class) + ->addTag('config.factory.override'); + } + + /** + * {@inheritdoc} + */ + public function loadOverrides($names) { + $overrides = []; + if (drupal_installation_attempted() && function_exists('drupal_install_profile_distribution_name')) { + // Early in the installer the site name is unknown. In this case we need + // to fallback to the distribution's name. + $overrides['system.site'] = [ + 'name' => drupal_install_profile_distribution_name(), + ]; + } + return $overrides; + } + + /** + * {@inheritdoc} + */ + public function getCacheSuffix() { + return 'core.install_config_override'; + } + + /** + * {@inheritdoc} + */ + public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) { + return NULL; + } + + /** + * {@inheritdoc} + */ + public function getCacheableMetadata($name) { + return new CacheableMetadata(); + } + +}