From 9d2005d8e8e085d91a774635e1be3a37819c80ca Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Thu, 12 Feb 2015 10:39:41 +0000 Subject: [PATCH] Fixing SensioLabs Insight 'Critical' violations. --- PHPCI/Command/DaemoniseCommand.php | 3 ++- PHPCI/Helper/WindowsCommandExecutor.php | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/PHPCI/Command/DaemoniseCommand.php b/PHPCI/Command/DaemoniseCommand.php index 915890bd..0bcd42f6 100644 --- a/PHPCI/Command/DaemoniseCommand.php +++ b/PHPCI/Command/DaemoniseCommand.php @@ -87,7 +87,8 @@ class DaemoniseCommand extends Command try { $buildCount = $runner->run($emptyInput, $output); } catch (\Exception $e) { - var_dump($e); + $output->writeln('Exception: ' . $e->getMessage() . ''); + $output->writeln('Line: ' . $e->getLine() . ' - File: ' . $e->getFile() . ''); } if (0 == $buildCount && $this->sleep < 15) { diff --git a/PHPCI/Helper/WindowsCommandExecutor.php b/PHPCI/Helper/WindowsCommandExecutor.php index aa01fea4..a1d0889f 100644 --- a/PHPCI/Helper/WindowsCommandExecutor.php +++ b/PHPCI/Helper/WindowsCommandExecutor.php @@ -22,6 +22,9 @@ class WindowsCommandExecutor extends BaseCommandExecutor */ protected function findGlobalBinary($binary) { - return trim(shell_exec('where ' . $binary)); + $command = sprintf('where %s', $binary); + $result = shell_exec($command); + + return trim($result); } }