change command to which available under most unix systems

agree i will change it which is available under suse, ubuntu, debian, fedora, bsd
This commit is contained in:
Gordon Franke 2014-08-07 13:29:58 +02:00 committed by Gordon Franke
parent 85e77b14f7
commit c70a226121

View File

@ -55,14 +55,14 @@ class Shell
} }
// todo: find a better way (command could not be available) // todo: find a better way (command could not be available)
$testCommand = 'command -v '; $testCommand = 'which ';
if (self::TYPE_WINDOWS === $this->type) { if (self::TYPE_WINDOWS === $this->type) {
$testCommand = 'where '; $testCommand = 'where ';
} }
$command = escapeshellcmd($command); $command = escapeshellcmd($command);
exec($testCommand . $command, $output, $code); exec($testCommand.$command, $output, $code);
return 0 === $code && count($output) > 0; return 0 === $code && count($output) > 0;
} }