province abbreviation patch - issue 724
[civicrm-core.git] / bin / cron.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
6b7eb9df 4 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 5 | |
6b7eb9df
TO
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
6a488035 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
6a488035
TO
11
12
13require_once '../civicrm.config.php';
14require_once 'CRM/Core/Config.php';
15require_once 'CRM/Utils/Request.php';
d523d24a 16CRM_Core_Config::singleton();
6a488035
TO
17
18CRM_Utils_System::authenticateScript(TRUE);
19
20$job = CRM_Utils_Request::retrieve('job', 'String', CRM_Core_DAO::$_nullArray, FALSE, NULL, 'REQUEST');
21
22require_once 'CRM/Core/JobManager.php';
23$facility = new CRM_Core_JobManager();
24
25if ($job === NULL) {
26 $facility->execute();
27}
28else {
29 $ignored = array("name", "pass", "key", "job");
30 $params = array();
31 foreach ($_REQUEST as $name => $value) {
32 if (!in_array($name, $ignored)) {
33 $params[$name] = CRM_Utils_Request::retrieve($name, 'String', CRM_Core_DAO::$_nullArray, FALSE, NULL, 'REQUEST');
34 }
35 }
36 $facility->setSingleRunParams('job', $job, $params, 'From cron.php');
37 $facility->executeJobByAction('job', $job);
38}