コード例 #1
0
ファイル: PushCommand.php プロジェクト: chervand/yii-push
 /**
  * Index action.
  * Processes message queue in endless loop.
  */
 public function actionIndex()
 {
     $this->log(get_class($this) . ' have been started.', CLogger::LEVEL_WARNING, 'command');
     while ($this->loop()) {
         try {
             $this->queue->process();
         } catch (Exception $e) {
             $this->log(get_class($e) . ': ' . $e->getMessage(), CLogger::LEVEL_ERROR, 'command');
             $this->terminate();
         }
     }
     $this->log(get_class($this) . ' have been finished.', CLogger::LEVEL_WARNING, 'command');
 }
コード例 #2
0
 public function process()
 {
     $this->out('Processing Queue.');
     if (Queue::process()) {
         $this->out('Success.');
     } else {
         $this->out('One or more failed, Check logs.');
     }
 }