瀏覽代碼

[Process] Better guess of php bin executable path

If PHP_PATH is not defined (default)
PHP_BINDIR is used to guess exe, but on windows this constant seems to be hardcoded and doesn't point to the good folder
So before to throw an error we check if PEAR is installed, most of the case it is, and it will have good php bin path for sure.
Pascal Borreli 14 年之前
父節點
當前提交
ef447dc487
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/Symfony/Component/Process/PhpProcess.php

+ 6 - 0
src/Symfony/Component/Process/PhpProcess.php

@@ -93,6 +93,12 @@ class PhpProcess extends Process
             }
         }
 
+        if ($php = getenv('PHP_PEAR_PHP_BIN')) {
+            if (is_executable($php)) {
+                return $php;
+            }
+        }
+
         throw new \RuntimeException('Unable to find the PHP executable.');
     }
 }