Esempio n. 1
0
<?php 
/**
 * cronjob-worker - Worker process for the cronjobs
 *
 * @author      Jan-Hendrik Willms <*****@*****.**>
 * @license     http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
 * @category    Stud.IP
 * @since       2.4
 */
// +---------------------------------------------------------------------------+
// This file is part of Stud.IP
// cronjob-worker.php
//
// Copyright (C) 2013 Jan-Hendrik Willms <*****@*****.**>
// +---------------------------------------------------------------------------+
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or any later version.
// +---------------------------------------------------------------------------+
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
// +---------------------------------------------------------------------------+
require_once 'studip_cli_env.inc.php';
CronjobScheduler::getInstance()->run();
Esempio n. 2
0
 /**
  * Unregisters a previously registered task.
  *
  * @param String $task_id Id of the task to be unregistered
  * @return CronjobScheduler to allow chaining
  * @throws InvalidArgumentException when no task with the given id exists
  */
 public static function unregister()
 {
     $class_name = get_called_class();
     $task = CronjobTask::findOneByClass($class_name);
     if ($task !== null) {
         CronjobScheduler::getInstance()->unregisterTask($task->id);
     }
 }