forked from backdrop/backdrop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcron.php
executable file
·32 lines (28 loc) · 1.04 KB
/
cron.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* @file
* Handles incoming requests to fire off regularly-scheduled tasks (cron jobs).
*/
/**
* Defines the root directory of the Backdrop installation.
*
* The dirname() function is used to get path to Backdrop root folder, which
* avoids resolving of symlinks. This allows the code repository to be a symlink
* and hosted outside of the web root. See issue #1297.
*/
define('BACKDROP_ROOT', dirname(dirname($_SERVER['SCRIPT_FILENAME'])));
// Change the directory to the Backdrop root.
chdir(BACKDROP_ROOT);
include_once BACKDROP_ROOT . '/core/includes/bootstrap.inc';
backdrop_bootstrap(BACKDROP_BOOTSTRAP_FULL);
if (!isset($_GET['cron_key']) || state_get('cron_key') != $_GET['cron_key']) {
watchdog('cron', 'Cron could not run because an invalid key was used.', array(), WATCHDOG_NOTICE);
backdrop_access_denied();
}
elseif (state_get('maintenance_mode', FALSE)) {
watchdog('cron', 'Cron could not run because the site is in maintenance mode.', array(), WATCHDOG_NOTICE);
backdrop_access_denied();
}
else {
backdrop_cron_run();
}