2014-05-09 14:09:27 +02:00
|
|
|
<?php
|
|
|
|
|
2016-07-19 20:28:11 +02:00
|
|
|
namespace PHPCensor\Helper;
|
2014-05-09 14:09:27 +02:00
|
|
|
|
2014-12-08 12:25:33 +01:00
|
|
|
/**
|
|
|
|
* Unix/Linux specific extension of the CommandExecutor class.
|
|
|
|
*/
|
2014-05-09 14:09:27 +02:00
|
|
|
class UnixCommandExecutor extends BaseCommandExecutor
|
|
|
|
{
|
2014-12-08 12:25:33 +01:00
|
|
|
/**
|
|
|
|
* Uses 'which' to find a system binary by name.
|
|
|
|
* @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
|
|
|
{
|
2014-07-04 11:02:27 +02:00
|
|
|
return trim(shell_exec('which ' . $binary));
|
2014-05-09 14:09:27 +02:00
|
|
|
}
|
|
|
|
}
|