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

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

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

include_once DRUPAL_ROOT . '/includes/bootstrap.inc';
15
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
16
17

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