phpci/PHPCI/Helper/WindowsCommandExecutor.php
2014-05-09 19:09:27 +07:00

34 lines
832 B
PHP

<?php
namespace PHPCI\Helper;
class WindowsCommandExecutor extends BaseCommandExecutor
{
/**
* Find a binary required by a plugin.
* @param string $binary
* @return null|string
*/
public function findBinary($binary)
{
$binaryPath = parent::findBinary($binary);
if (is_null($binaryPath)) {
if (is_string($binary)) {
$binary = array($binary);
}
foreach ($binary as $bin) {
$findCmdResult = trim(shell_exec('where ' . $bin));
if (!empty($findCmdResult)) {
$this->logger->log("Found in " . $findCmdResult, LogLevel::DEBUG);
$binaryPath = $findCmdResult;
break;
}
}
}
return $binaryPath;
}
}