Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. system.install

function system_install

Implements hook_install().

File

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

Code

function system_install() : void {
    // 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::service('asset.query_string')->reset();
}
RSS feed
Powered by Drupal