diff --git a/src/FFMpeg/Binary.php b/src/FFMpeg/Binary.php index 2e24e68..bc99b53 100644 --- a/src/FFMpeg/Binary.php +++ b/src/FFMpeg/Binary.php @@ -37,7 +37,9 @@ abstract class Binary implements AdapterInterface public static function load(\Monolog\Logger $logger = null) { - if ('' === $binary = self::autodetect(static::getBinaryName())) + $finder = new \Symfony\Component\Process\ExecutableFinder(); + + if (null === $binary = $finder->find(static::getBinaryName())) { throw new Exception\BinaryNotFoundException('Binary not found'); } @@ -61,17 +63,6 @@ abstract class Binary implements AdapterInterface return $result; } - /** - * Autodetect the presence of a binary - * - * @param string $binaryName - * @return string - */ - protected static function autodetect($binaryName) - { - return trim(self::run(sprintf('which %s', escapeshellarg($binaryName)), true)); - } - protected static function getBinaryName() { throw new Exception('Should be implemented');