debug mode and clean up

This commit is contained in:
Simon Vieille 2015-07-14 00:25:03 +02:00
parent d139fdd481
commit 8e20fbb50a
2 changed files with 4 additions and 9 deletions

View file

@ -21,11 +21,6 @@ class ListCommand extends Command
protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output)
{ {
// $this->getContainer()->get('foo.bar');
// $output->writeln(sprintf('<comment>%s</comment> bar.', $example));
// $input->getArgument('foo');
// $input->getOption('bar');
$liveCoding = $this->getApplication()->getContainer()['livecoding']; $liveCoding = $this->getApplication()->getContainer()['livecoding'];
try { try {

View file

@ -28,7 +28,7 @@ class PlayCommand extends Command
$stream = strtolower(trim($input->getArgument('stream'), "/ \r\n")); $stream = strtolower(trim($input->getArgument('stream'), "/ \r\n"));
if (0 === preg_match('/^\w+$/', $stream)) { if (0 === preg_match('/^\w+$/', $stream)) {
$output->writeln('<error>The stream name is not valid.'); $output->writeln('<error>The stream name is not valid.</error>');
return false; return false;
} }
@ -37,15 +37,15 @@ class PlayCommand extends Command
if (!empty($config['player']['before'])) { if (!empty($config['player']['before'])) {
$command = $config['player']['before']; $command = $config['player']['before'];
// $process = new Process($command); $process = new Process($command);
// $process->run(); $process->run();
} }
$hash = $this->getHash($this->getApplication()->buildUrl($stream.'/')); $hash = $this->getHash($this->getApplication()->buildUrl($stream.'/'));
$command = $this->getApplication()->getPlayer($stream.'?t='.$hash); $command = $this->getApplication()->getPlayer($stream.'?t='.$hash);
$process = new Process($command); $process = new Process($command);
if ($this->getApplication()->isDebugMode()) { if (!$this->getApplication()->isDebugMode()) {
$callback = function ($type, $buffer) use ($output) { $callback = function ($type, $buffer) use ($output) {
if ('err' !== $type) { if ('err' !== $type) {
$output->writeln($buffer); $output->writeln($buffer);