You are here

function install_finished in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/includes/install.core.inc \install_finished()

Performs final installation steps and displays a 'finished' page.

Parameters

$install_state: An array of information about the current installation state.

Return value

A message informing the user that the installation is complete.

File

core/includes/install.core.inc, line 1752
API functions for installing Drupal.

Code

function install_finished(&$install_state) {
  $profile = drupal_get_profile();

  // Installation profiles are always loaded last.
  module_set_weight($profile, 1000);

  // Build the router once after installing all modules.
  // This would normally happen upon KernelEvents::TERMINATE, but since the
  // installer does not use an HttpKernel, that event is never triggered.
  \Drupal::service('router.builder')
    ->rebuild();

  // Run cron to populate update status tables (if available) so that users
  // will be warned if they've installed an out of date Drupal version.
  // Will also trigger indexing of profile-supplied content or feeds.
  \Drupal::service('cron')
    ->run();
  if ($install_state['interactive']) {

    // Load current user and perform final login tasks.
    // This has to be done after drupal_flush_all_caches()
    // to avoid session regeneration.
    $account = User::load(1);
    user_login_finalize($account);
  }
  $success_message = t('Congratulations, you installed @drupal!', array(
    '@drupal' => drupal_install_profile_distribution_name(),
  ));
  drupal_set_message($success_message);
}