cron.php 783 Bytes
Newer Older
1
<?php
Steven Wittens's avatar
Steven Wittens committed
2

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

8 9 10
// Change the directory to the Drupal root.
chdir('..');

11 12 13
/**
 * Root directory of Drupal installation.
 */
14
define('DRUPAL_ROOT', getcwd());
15

16
include_once DRUPAL_ROOT . '/core/includes/bootstrap.inc';
17
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
18 19

if (!isset($_GET['cron_key']) || variable_get('cron_key', 'drupal') != $_GET['cron_key']) {
20
  watchdog('cron', 'Cron could not run because an invalid key was used.', array(), WATCHDOG_NOTICE);
21
  drupal_access_denied();
22
}
23
elseif (variable_get('maintenance_mode', 0)) {
24
  watchdog('cron', 'Cron could not run because the site is in maintenance mode.', array(), WATCHDOG_NOTICE);
25 26 27 28 29
  drupal_access_denied();
}
else {
  drupal_cron_run();
}