Launch the need cron tasks
public static launch ( $mode, $max = 1, $name = '' ) : the | ||
$mode | (internal/external, <0 to force) | |
$max | number of task to launch (default 1) | |
$name | of task to run (default '') | |
Результат | the | name of last task launched |
header("Cache-Control: no-cache,no-store"); header("Pragma: no-cache"); header("Connection: close"); echo $image; flush(); CronTask::launch(CronTask::MODE_INTERNAL); } else { if (isset($_SERVER['argc']) && $_SERVER['argc'] > 1) { // Parse command line options $mode = CronTask::MODE_EXTERNAL; // when taskname given, will allow --force for ($i = 1; $i < $_SERVER['argc']; $i++) { if ($_SERVER['argv'][$i] == '--force') { $mode = -CronTask::MODE_EXTERNAL; } else { if (is_numeric($_SERVER['argv'][$i])) { // Number of tasks CronTask::launch(CronTask::MODE_EXTERNAL, intval($_SERVER['argv'][$i])); // Only check first parameter when numeric is passed break; } else { // Task name CronTask::launch($mode, $CFG_GLPI['cron_limit'], $_SERVER['argv'][$i]); } } } } else { // Default from configuration CronTask::launch(CronTask::MODE_EXTERNAL, $CFG_GLPI['cron_limit']); } }
along with GLPI. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ /** @file * @brief Form to edit Cron Task */ include '../inc/includes.php'; Session::checkRight("config", UPDATE); $crontask = new CronTask(); if (isset($_POST['execute'])) { if (is_numeric($_POST['execute'])) { // Execute button from list. $name = CronTask::launch(CronTask::MODE_INTERNAL, intval($_POST['execute'])); } else { // Execute button from Task form (force) $name = CronTask::launch(-CronTask::MODE_INTERNAL, 1, $_POST['execute']); } if ($name) { //TRANS: %s is a task name Session::addMessageAfterRedirect(sprintf(__('Task %s executed'), $name)); } Html::back(); } else { if (isset($_POST["update"])) { Session::checkRight('config', UPDATE); $crontask->update($_POST); Html::back(); } else { if (isset($_POST['resetdate']) && isset($_POST["id"])) { Session::checkRight('config', UPDATE); if ($crontask->getFromDB($_POST["id"])) {