Exemplo n.º 1
0
 public function execute()
 {
     if ($this->canExecute()) {
         return;
     }
     try {
         $target = $this->getTarget();
     } catch (\Exception $ex) {
         \Leno\Console\Io\Stdout::error($ex->getMessage());
         return;
     }
     $shell = $target->newInstance();
     $needed = $shell->getArgsNeeded($this->action);
     foreach ($needed as $key => $need) {
         foreach ($this->args as $arg => $val) {
             if (in_array($arg, $need)) {
                 $shell->setArg($key, $val);
             }
         }
     }
     $target->getMethod($this->action)->invoke($shell);
 }
Exemplo n.º 2
0
 public function output($msg)
 {
     \Leno\Console\Io\Stdout::output($msg);
     return $this;
 }