cron.php 690 Bytes
Newer Older
1
<?php
Steven Wittens's avatar
Steven Wittens committed
2 3
// $Id$

4 5
/**
 * @file
6
 * Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).
7 8
 */

9
include_once 'includes/bootstrap.inc';
10
drupal_bootstrap('full');
11

Steven Wittens's avatar
Steven Wittens committed
12
// If not in 'safe mode', increase the maximum execution time:
13
if (!ini_get('safe_mode')) {
14
  set_time_limit(240);
Dries's avatar
Dries committed
15 16
}

Steven Wittens's avatar
Steven Wittens committed
17 18
// Check if the last cron run completed
if (variable_get('cron_busy', false)) {
19
  watchdog('cron', t('Last cron run did not complete.'), WATCHDOG_WARNING);
Steven Wittens's avatar
Steven Wittens committed
20 21 22 23 24 25 26
}
else {
  variable_set('cron_busy', true);
}

// Iterate through the modules calling their cron handlers (if any):
module_invoke_all('cron');
Dries's avatar
Dries committed
27

Steven Wittens's avatar
Steven Wittens committed
28 29
// Clean up
variable_set('cron_busy', false);
30
watchdog('cron', t('Cron run completed'));
31

32
?>