示例#1
0
 /**
  * executes the cron functions from the callback
  * @return function outup
  */
 public function execute_call_back()
 {
     $return = FALSE;
     if ($this->loaded()) {
         if (Cron::function_exists($this->callback)) {
             $params = explode(self::PARAMS_SEPARATOR, $this->params);
             if (is_array($params)) {
                 $return = call_user_func_array($this->callback, $params);
             } else {
                 $return = call_user_func($this->callback);
             }
         } else {
             //if function not found deactivate the cron
             $this->date_started = Date::unix2mysql();
             $this->active = 0;
             $this->running = 0;
             $this->output = 'Error: Function not found';
             $this->save();
         }
     }
     return $return;
 }
示例#2
0
文件: cron.php 项目: demoic/common
 /**
  * executes the cron functions from the callback
  * @return function outup
  */
 public function execute_call_back()
 {
     $return = FALSE;
     if ($this->loaded()) {
         if (Cron::function_exists($this->callback)) {
             $params = explode(self::PARAMS_SEPARATOR, $this->params);
             try {
                 if (is_array($params)) {
                     $return = call_user_func_array($this->callback, $params);
                 } else {
                     $return = call_user_func($this->callback);
                 }
             } catch (Exception $e) {
                 Kohana::$log->add(Log::ERROR, 'Cron - ' . $this->callback . ' - ' . print_r($e->getMessage(), 1));
             }
         } else {
             //if function not found deactivate the cron
             $this->date_started = Date::unix2mysql();
             $this->active = 0;
             $this->running = 0;
             $this->output = 'Error: Function not found';
             $this->save();
         }
     }
     return $return;
 }