function install_finished in Drupal 7
Same name and namespace in other branches
- 8 core/includes/install.core.inc \install_finished()
- 9 core/includes/install.core.inc \install_finished()
- 10 core/includes/install.core.inc \install_finished()
Finishes importing files at end of installation.
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
- includes/
install.core.inc, line 1567 - API functions for installing Drupal.
Code
function install_finished(&$install_state) {
drupal_set_title(st('@drupal installation complete', array(
'@drupal' => drupal_install_profile_distribution_name(),
)), PASS_THROUGH);
$messages = drupal_set_message();
$output = '<p>' . st('Congratulations, you installed @drupal!', array(
'@drupal' => drupal_install_profile_distribution_name(),
)) . '</p>';
$output .= '<p>' . (isset($messages['error']) ? st('Review the messages above before visiting <a href="@url">your new site</a>.', array(
'@url' => url(''),
)) : st('<a href="@url">Visit your new site</a>.', array(
'@url' => url(''),
))) . '</p>';
// Flush all caches to ensure that any full bootstraps during the installer
// do not leave stale cached data, and that any content types or other items
// registered by the installation profile are registered correctly.
drupal_flush_all_caches();
// Remember the profile which was used.
variable_set('install_profile', drupal_get_profile());
// Installation profiles are always loaded last
db_update('system')
->fields(array(
'weight' => 1000,
))
->condition('type', 'module')
->condition('name', drupal_get_profile())
->execute();
// Cache a fully-built schema.
drupal_get_schema(NULL, TRUE);
// 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_cron_run();
return $output;
}