コード例 #1
0
 public function onActivate() {
     $taskRunner = new Gpf_Tasks_Runner();
     if (!$taskRunner->isRunningOK()) {
         throw new Gpf_Exception($this->_('Auto approval of commissions plugin require cron job which is not running now. Please set it up in Tools -> Integration -> Cron Job Integration'));
     }
     $this->addAutoApprovalCommissionsTask();
 }
コード例 #2
0
 public function onActivate() {
     $taskRunner = new Gpf_Tasks_Runner();
     if (!$taskRunner->isRunningOK()) {
         throw new Gpf_Exception($this->_('Recurring commissions require cron job which is not running now. Please set it up in Tools -> Integration -> Cron Job Integration'));
     }
     
     $config = new Pap_Features_RecurringCommissions_Config();
     $config->addRecurringCommissionsTask();
 }
コード例 #3
0
 /**
  * @service cronjob read
  * 
  * @param Gpf_Rpc_Params $params
  * @return Gpf_Rpc_Data
  */
 public function load(Gpf_Rpc_Params $params) {
     $form = new Gpf_Rpc_Form($params);
     
     $runner = new Gpf_Tasks_Runner();
     if (!$runner->isRunningOK()) {
         $form->setField('warningMessage', $this->_('Cron job is not running'));
     }
     $form->setField('lastRunTime', $runner->getLastRunTime());
     $form->setField('cronCommand', $this->getCronCommand());
     $form->setField(Gpf_Settings_Gpf::CRON_RUN_INTERVAL, Gpf_Settings::get(Gpf_Settings_Gpf::CRON_RUN_INTERVAL));
     return $form;
 }
コード例 #4
0
 protected function isCronRunning() {
     $taskRunner = new Gpf_Tasks_Runner();
     return $taskRunner->isRunningOK();
 }
コード例 #5
0
ファイル: jobs.php プロジェクト: AmineCherrai/rostanvo
$inclusion_type = null;
$inclusion_tasks = array();

if (isset($argv) && count($argv) >= 3) {
	if ($argv[1] == '--include') {
	   $inclusion_type = Gpf_Tasks_Runner::INCLUDE_TASKS;
	} else if ($argv[1] == '--exclude') {
	   $inclusion_type = Gpf_Tasks_Runner::EXCLUDE_TASKS;
	}	
	foreach ($argv as $key => $argument) {
		if ($key > 1) $inclusion_tasks[] = $argument;
	}
}

Gpf_Session::create(new Pap_Tracking_ModuleBase(), null, false);
$taskRunner = new Gpf_Tasks_Runner();

if (isset($_REQUEST['time'])) {
    $timeFrame = $_REQUEST['time'];
} else {
    if ($inclusion_type !== null) {
        $timeFrame = Gpf_Settings::get(Gpf_Settings_Gpf::CRON_RUN_INTERVAL)*60 - 20;    
    } else {
        $timeFrame = 50;
    }
}

$taskRunner->run($timeFrame, $inclusion_type, $inclusion_tasks);

$content = ob_get_contents();
ob_end_clean();