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
1 changed files with 2 additions and 2 deletions

View File

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