comparison vendor/symfony/process/PhpExecutableFinder.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents c2387f117808
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
37 { 37 {
38 $args = $this->findArguments(); 38 $args = $this->findArguments();
39 $args = $includeArgs && $args ? ' '.implode(' ', $args) : ''; 39 $args = $includeArgs && $args ? ' '.implode(' ', $args) : '';
40 40
41 // HHVM support 41 // HHVM support
42 if (defined('HHVM_VERSION')) { 42 if (\defined('HHVM_VERSION')) {
43 return (getenv('PHP_BINARY') ?: PHP_BINARY).$args; 43 return (getenv('PHP_BINARY') ?: PHP_BINARY).$args;
44 } 44 }
45 45
46 // PHP_BINARY return the current sapi executable 46 // PHP_BINARY return the current sapi executable
47 if (PHP_BINARY && \in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg'), true)) { 47 if (PHP_BINARY && \in_array(\PHP_SAPI, ['cli', 'cli-server', 'phpdbg'], true)) {
48 return PHP_BINARY.$args; 48 return PHP_BINARY.$args;
49 } 49 }
50 50
51 if ($php = getenv('PHP_PATH')) { 51 if ($php = getenv('PHP_PATH')) {
52 if (!@is_executable($php)) { 52 if (!@is_executable($php)) {
60 if (@is_executable($php)) { 60 if (@is_executable($php)) {
61 return $php; 61 return $php;
62 } 62 }
63 } 63 }
64 64
65 if (@is_executable($php = PHP_BINDIR.('\\' === DIRECTORY_SEPARATOR ? '\\php.exe' : '/php'))) { 65 if (@is_executable($php = PHP_BINDIR.('\\' === \DIRECTORY_SEPARATOR ? '\\php.exe' : '/php'))) {
66 return $php; 66 return $php;
67 } 67 }
68 68
69 $dirs = array(PHP_BINDIR); 69 $dirs = [PHP_BINDIR];
70 if ('\\' === DIRECTORY_SEPARATOR) { 70 if ('\\' === \DIRECTORY_SEPARATOR) {
71 $dirs[] = 'C:\xampp\php\\'; 71 $dirs[] = 'C:\xampp\php\\';
72 } 72 }
73 73
74 return $this->executableFinder->find('php', false, $dirs); 74 return $this->executableFinder->find('php', false, $dirs);
75 } 75 }
79 * 79 *
80 * @return array The PHP executable arguments 80 * @return array The PHP executable arguments
81 */ 81 */
82 public function findArguments() 82 public function findArguments()
83 { 83 {
84 $arguments = array(); 84 $arguments = [];
85 85
86 if (defined('HHVM_VERSION')) { 86 if (\defined('HHVM_VERSION')) {
87 $arguments[] = '--php'; 87 $arguments[] = '--php';
88 } elseif ('phpdbg' === PHP_SAPI) { 88 } elseif ('phpdbg' === \PHP_SAPI) {
89 $arguments[] = '-qrr'; 89 $arguments[] = '-qrr';
90 } 90 }
91 91
92 return $arguments; 92 return $arguments;
93 } 93 }