diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 914e20d..6f4b859 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -253,9 +253,19 @@ function install_state_defaults() { * modified with information gleaned from the beginning of the page request. */ function install_begin_request(&$install_state) { + // A request object from the HTTPFoundation to tell us about the request. + $request = Request::createFromGlobals(); + + // Create a minimal container for t() and request to work. This container will + // be overriden but it needed for the very early installation process when + // database tasks run. + $container = new ContainerBuilder(); + $container->set('request', $request); + \Drupal::setContainer($container); + // Add any installation parameters passed in via the URL. if ($install_state['interactive']) { - $install_state['parameters'] += \Drupal::request()->query->all(); + $install_state['parameters'] += $request->query->all(); } // Validate certain core settings that are used throughout the installation. @@ -288,13 +298,10 @@ function install_begin_request(&$install_state) { // _drupal_load_test_overrides() sets the simpletest_conf_path in-memory // setting in this case. if ($install_state['interactive'] && drupal_valid_test_ua() && !settings()->get('simpletest_conf_path')) { - header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden'); + header($request->server->get('SERVER_PROTOCOL') . ' 403 Forbidden'); exit; } - // A request object from the HTTPFoundation to tell us about the request. - $request = Request::createFromGlobals(); - // If we have a language selected and it is not yet saved in the system // (eg. pre-database data screens we are unable to persistently store // the default language), we should set language_default so the proper @@ -324,10 +331,6 @@ function install_begin_request(&$install_state) { // Determine whether the configuration system is ready to operate. $install_state['config_verified'] = install_verify_config_directory(CONFIG_ACTIVE_DIRECTORY) && install_verify_config_directory(CONFIG_STAGING_DIRECTORY); - // Create a minimal container for t() to work. - // This container will be overriden but it needed for the very early - // installation process when database tasks run. - $container = new ContainerBuilder(); // Register the translation services. install_register_translation_service($container); \Drupal::setContainer($container); diff --git a/core/profiles/standard/standard.profile b/core/profiles/standard/standard.profile index d554c93..209107d 100644 --- a/core/profiles/standard/standard.profile +++ b/core/profiles/standard/standard.profile @@ -11,5 +11,5 @@ */ function standard_form_install_configure_form_alter(&$form, $form_state) { // Pre-populate the site name with the server name. - $form['site_information']['site_name']['#default_value'] = $_SERVER['SERVER_NAME']; + $form['site_information']['site_name']['#default_value'] = \Drupal::request()->server->get('SERVER_NAME'); }