Example #1
0
 public function mock_doRun()
 {
     $this->Arguments = func_get_args();
     $this->Input->readline(1024);
     $this->Output->write('foo', IOutput::STDOUT);
     $this->Output->write('foo', IOutput::STDERR);
     return -1;
 }
Example #2
0
 /**
  * Prints a message to output.
  *
  * @param string $Message
  * @param \BLW\Type\Command\IInput $Input
  *            Input object to read data from.
  * @param \BLW\Type\Command\IOutput $Output
  *            Output object to write data to.
  * @param integer $flags
  *            Flags used to run commands.
  * @return int Exit code (0)
  */
 private function _die($Message, IInput $Input, IOutput $Output, $flags)
 {
     // Cron already running
     $Command = new CallbackCommand(function ($Input, $Output) use($Message) {
         // Output notice
         $Output->write($Message);
         // Done
         return 0;
     }, new GenericConfig(array('Timeout' => 10)));
     return $Command->run($Input, $Output, $flags);
 }