/**
  * Runs a command and returns it output
  *
  * @param \Symfony\Component\HttpKernel\Client $client
  * @param                                      $command
  *
  * @return string|\Symfony\Component\Console\Output\StreamOutput
  */
 public function runCommand(Client $client, $command)
 {
     $application = new Application($client->getKernel());
     $application->setAutoExit(false);
     $fp = tmpfile();
     $input = new StringInput($command);
     $output = new StreamOutput($fp);
     $application->run($input, $output);
     fseek($fp, 0);
     $output = '';
     while (!feof($fp)) {
         $output = fread($fp, 4096);
     }
     fclose($fp);
     return $output;
 }
Example #2
0
 /**
  * Set whether the Console app should auto-exit when done.
  *
  * @param bool $boolean
  * @return $this 
  * @static 
  */
 public static function setAutoExit($boolean)
 {
     return \Illuminate\Console\Application::setAutoExit($boolean);
 }