You are here

function elysia_cron_install in Elysia Cron 7.2

Same name and namespace in other branches
  1. 5.2 elysia_cron.install \elysia_cron_install()
  2. 5 elysia_cron.install \elysia_cron_install()
  3. 6.2 elysia_cron.install \elysia_cron_install()
  4. 6 elysia_cron.install \elysia_cron_install()
  5. 7 elysia_cron.install \elysia_cron_install()

Implements hook_install().

File

./elysia_cron.install, line 127
Install, update and uninstall functions for the elysia_cron module.

Code

function elysia_cron_install() {

  // Elysia cron MUST be the first returned by module_list.
  // This is to ensure elysia_cron_cron is the first hook
  // called by standard cron.php.
  $query = db_select('system');
  $query
    ->addExpression('MIN(weight)');
  $min = $query
    ->execute()
    ->fetchField();
  $min = $min > -65535 ? -65535 : --$min;
  db_update('system')
    ->fields(array(
    'weight' => $min,
  ))
    ->condition('name', 'elysia_cron')
    ->execute();
}