Skip to content

Commit

Permalink
Update ServerCommand.php (#3472)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackbravo authored and jmolivas committed Aug 31, 2017
1 parent 8173853 commit aa99142
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Command/ServerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
)
);

if ($io->getVerbosity() > OutputInterface::VERBOSITY_NORMAL) {
$callback = [$this, 'outputCallback'];
} else {
$callback = null;
}

// Use the process helper to copy process output to console output.
$this->getHelper('process')->run($output, $process, null, null);
$this->getHelper('process')->run($output, $process, null, $callback);

if (!$process->isSuccessful()) {
$io->error($process->getErrorOutput());
Expand Down Expand Up @@ -165,4 +171,9 @@ private function validatePort($address)

return $address;
}

function outputCallback($type, $buffer) {
// TODO: seems like $type is Process::ERR always
echo $buffer;
}
}

0 comments on commit aa99142

Please sign in to comment.