Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / process / PhpExecutableFinder.php
index db31cc1b3ce8b2c354ef975c45049f96279ee7c5..67015902217865431e5ecb7021ef31f3cc173494 100644 (file)
@@ -44,12 +44,12 @@ class PhpExecutableFinder
         }
 
         // PHP_BINARY return the current sapi executable
-        if (PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg')) && is_file(PHP_BINARY)) {
+        if (PHP_BINARY && \in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg'), true)) {
             return PHP_BINARY.$args;
         }
 
         if ($php = getenv('PHP_PATH')) {
-            if (!is_executable($php)) {
+            if (!@is_executable($php)) {
                 return false;
             }
 
@@ -57,11 +57,15 @@ class PhpExecutableFinder
         }
 
         if ($php = getenv('PHP_PEAR_PHP_BIN')) {
-            if (is_executable($php)) {
+            if (@is_executable($php)) {
                 return $php;
             }
         }
 
+        if (@is_executable($php = PHP_BINDIR.('\\' === DIRECTORY_SEPARATOR ? '\\php.exe' : '/php'))) {
+            return $php;
+        }
+
         $dirs = array(PHP_BINDIR);
         if ('\\' === DIRECTORY_SEPARATOR) {
             $dirs[] = 'C:\xampp\php\\';