function system_install

Same name in other branches
  1. 7.x modules/system/system.install \system_install()
  2. 8.9.x core/modules/system/system.install \system_install()
  3. 10 core/modules/system/system.install \system_install()
  4. 11.x core/modules/system/system.install \system_install()

Implements hook_install().

File

core/modules/system/system.install, line 1453

Code

function system_install() {
    // Populate the cron key state variable.
    $cron_key = Crypt::randomBytesBase64(55);
    \Drupal::state()->set('system.cron_key', $cron_key);
    // Populate the site UUID and default name (if not set).
    $site = \Drupal::configFactory()->getEditable('system.site');
    $site->set('uuid', \Drupal::service('uuid')->generate());
    if (!$site->get('name')) {
        $site->set('name', 'Drupal');
    }
    $site->save(TRUE);
    // Populate the dummy query string added to all CSS and JavaScript files.
    _drupal_flush_css_js();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.