Mercurial > hg > rr-repo
diff cron.php @ 0:ff03f76ab3fe
initial version
author | danieleb <danielebarchiesi@me.com> |
---|---|
date | Wed, 21 Aug 2013 18:51:11 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cron.php Wed Aug 21 18:51:11 2013 +0100 @@ -0,0 +1,26 @@ +<?php + +/** + * @file + * Handles incoming requests to fire off regularly-scheduled tasks (cron jobs). + */ + +/** + * Root directory of Drupal installation. + */ +define('DRUPAL_ROOT', getcwd()); + +include_once DRUPAL_ROOT . '/includes/bootstrap.inc'; +drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); + +if (!isset($_GET['cron_key']) || variable_get('cron_key', 'drupal') != $_GET['cron_key']) { + watchdog('cron', 'Cron could not run because an invalid key was used.', array(), WATCHDOG_NOTICE); + drupal_access_denied(); +} +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(); +}