function user_install

Implements hook_install().

File

drupal/core/modules/user/user.install, line 275
Install, update and uninstall functions for the user module.

Code

function user_install() {

  // Insert a row for the anonymous user.
  db_insert('users')
    ->fields(array(
    'uid' => 0,
    'name' => '',
    'mail' => '',
  ))
    ->execute();

  // We need some placeholders here as name and mail are uniques and data is
  // presumed to be a serialized array. This will be changed by the settings
  // form in the installer.
  db_insert('users')
    ->fields(array(
    'uid' => 1,
    'name' => 'placeholder-for-uid-1',
    'mail' => 'placeholder-for-uid-1',
    'created' => REQUEST_TIME,
    'status' => 1,
  ))
    ->execute();
}