public function afterAction($action, $result)
 {
     $result = parent::afterAction($action, $result);
     foreach ($this->_savedCommands as $targetClass => $args) {
         if (array_key_exists($targetClass, $this->_commands)) {
             $this->_commands[$targetClass] = $args + $this->_commands[$targetClass];
         } else {
             $this->_commands[$targetClass] = $args;
         }
     }
     file_put_contents($this->filename, Json::encode($this->_commands, \JSON_PRETTY_PRINT));
     return $result;
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function afterAction($action, $result)
 {
     //file_put_contents(\Yii::getAlias('@runtime/logs/last_ip'),  self::$ip. "\n");
     $this->showTime();
     return parent::afterAction($action, $result);
 }
Example #3
0
 /**
  * After action event
  *
  * @param \yii\base\Action $action
  * @param mixed $result
  *
  * @return mixed
  */
 public function afterAction($action, $result)
 {
     $result = parent::afterAction($action, $result);
     $this->stdout("Command `{$this->command}` finished at the " . Yii::$app->formatter->asDatetime(time()) . "\n", Console::FG_GREEN);
     return $result;
 }
Example #4
0
 public function afterAction($action, $result)
 {
     if (FALSE === array_search($action->id, $this->_exludeAction)) {
         //Should remove in stable versions, but nice little fallback just in case
         $this->showInput();
         //Two newlines B4 program exit
         if (!$this->preventDefault) {
             $this->printStatus();
         }
     }
     return parent::afterAction($action, $result);
 }