Issue #336483 by brianV, catch: Fixed Performance: SELECT MAX(comment_count()) FROM...
[project/drupal.git] / cron.php
CommitLineData
accd5f0c 1<?php
1e1144f1 2
94e30bf7
DB
3/**
4 * @file
b84b6e42 5 * Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).
94e30bf7
DB
6 */
7
a3bb66e4
AB
8/**
9 * Root directory of Drupal installation.
10 */
d802c69a 11define('DRUPAL_ROOT', getcwd());
a3bb66e4
AB
12
13include_once DRUPAL_ROOT . '/includes/bootstrap.inc';
ba166016 14drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
ad0ce48e
AB
15
16if (!isset($_GET['cron_key']) || variable_get('cron_key', 'drupal') != $_GET['cron_key']) {
ba5609c1 17 watchdog('cron', 'Cron could not run because an invalid key was used.', array(), WATCHDOG_NOTICE);
fe7761fc 18 drupal_access_denied();
37a36275 19}
ad0ce48e
AB
20elseif (variable_get('maintenance_mode', 0)) {
21 watchdog('cron', 'Cron could not run because the site is in maintenance mode.', array(), WATCHDOG_NOTICE);
22 drupal_access_denied();
23}
24else {
25 drupal_cron_run();
26}