W3cubDocs

/Drupal 8

function drupal_install_system

drupal_install_system($install_state)

Installs the system module.

Separated from the installation of other modules so core system functions can be made available while other modules are installed.

Parameters

array $install_state: An array of information about the current installation state. This is used to set the default language.

File

core/includes/install.inc, line 608
API functions for installing modules and themes.

Code

function drupal_install_system($install_state) {
  // Remove the service provider of the early installer.
  unset($GLOBALS['conf']['container_service_providers']['InstallerServiceProvider']);

  $request = \Drupal::request();
  // Reboot into a full production environment to continue the installation.
  /** @var \Drupal\Core\Installer\InstallerKernel $kernel */
  $kernel = \Drupal::service('kernel');
  $kernel->shutdown();
  // Have installer rebuild from the disk, rather then building from scratch.
  $kernel->rebuildContainer(FALSE);
  $kernel->prepareLegacyRequest($request);

  // Install base system configuration.
  \Drupal::service('config.installer')->installDefaultConfig('core', 'core');

  // Install System module and rebuild the newly available routes.
  $kernel->getContainer()->get('module_installer')->install(array('system'), FALSE);
  \Drupal::service('router.builder')->rebuild();

  // Ensure default language is saved.
  if (isset($install_state['parameters']['langcode'])) {
    \Drupal::configFactory()->getEditable('system.site')
      ->set('langcode', (string) $install_state['parameters']['langcode'])
      ->set('default_langcode', (string) $install_state['parameters']['langcode'])
      ->save(TRUE);
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!includes!install.inc/function/drupal_install_system/8.1.x