You are here

function system_install in Drupal 7

Same name and namespace in other branches
  1. 8 core/modules/system/system.install \system_install()
  2. 5 modules/system/system.install \system_install()
  3. 6 modules/system/system.install \system_install()
  4. 9 core/modules/system/system.install \system_install()

Implements hook_install().

File

modules/system/system.install, line 629
Install, update and uninstall functions for the system module.

Code

function system_install() {

  // Create tables.
  drupal_install_schema('system');
  $versions = drupal_get_schema_versions('system');
  $version = $versions ? max($versions) : SCHEMA_INSTALLED;
  drupal_set_installed_schema_version('system', $version);

  // Clear out module list and hook implementation statics before calling
  // system_rebuild_theme_data().
  module_list(TRUE);
  module_implements('', FALSE, TRUE);

  // Ensure the schema versions are not based on a previous module list.
  drupal_static_reset('drupal_get_schema_versions');

  // Load system theme data appropriately.
  system_rebuild_theme_data();

  // Enable the default theme.
  variable_set('theme_default', 'bartik');
  db_update('system')
    ->fields(array(
    'status' => 1,
  ))
    ->condition('type', 'theme')
    ->condition('name', 'bartik')
    ->execute();

  // Populate the cron key variable.
  $cron_key = drupal_random_key();
  variable_set('cron_key', $cron_key);
}