Skip to content

Commit e1c0509

Browse files
committed
using symfony class to find PHP
1 parent 9204dc3 commit e1c0509

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/PatternLab/Console.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use \PatternLab\Console\Event as ConsoleEvent;
1818
use \PatternLab\Dispatcher;
1919
use \PatternLab\Timer;
20+
use \Symfony\Component\Process\PhpExecutableFinder;
2021

2122
class Console {
2223

@@ -170,7 +171,9 @@ public static function getCommand() {
170171
*/
171172
public static function getPathPHP() {
172173

173-
$path = isset($_SERVER["_"]) ? $_SERVER["_"] : Config::getOption("phpBin");
174+
$manualPHP = Config::getOption("phpBin");
175+
$autoPHP = new PhpExecutableFinder();
176+
$path = $manualPHP ? $manualPHP : $autoPHP->find();
174177

175178
if (!$path) {
176179
$configPath = Console::getHumanReadablePath(Config::getOption("configPath"));

0 commit comments

Comments
 (0)