2014-05-09 14:09:27 +02:00
|
|
|
<?php
|
2014-05-12 18:26:17 +02:00
|
|
|
/**
|
|
|
|
* PHPCI - Continuous Integration for PHP
|
|
|
|
*
|
|
|
|
* @copyright Copyright 2014, Block 8 Limited.
|
|
|
|
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
|
|
|
|
* @link https://www.phptesting.org/
|
|
|
|
*/
|
2014-05-09 14:09:27 +02:00
|
|
|
|
|
|
|
namespace PHPCI\Helper;
|
|
|
|
|
2014-12-08 12:25:33 +01:00
|
|
|
/**
|
|
|
|
* Windows-specific extension of the CommandExecutor class.
|
|
|
|
* @package PHPCI\Helper
|
|
|
|
*/
|
2014-05-09 14:09:27 +02:00
|
|
|
class WindowsCommandExecutor extends BaseCommandExecutor
|
|
|
|
{
|
2014-12-08 12:25:33 +01:00
|
|
|
/**
|
|
|
|
* Use 'where' on Windows to find a binary, rather than 'which'
|
|
|
|
* @param string $binary
|
|
|
|
* @return null|string
|
|
|
|
*/
|
2014-07-04 11:02:27 +02:00
|
|
|
protected function findGlobalBinary($binary)
|
2014-05-09 14:09:27 +02:00
|
|
|
{
|
2015-02-12 11:39:41 +01:00
|
|
|
$command = sprintf('where %s', $binary);
|
|
|
|
$result = shell_exec($command);
|
|
|
|
|
|
|
|
return trim($result);
|
2014-05-09 14:09:27 +02:00
|
|
|
}
|
|
|
|
}
|