8000 #25187 Lookup php binary in PHP_BINDIR first · symfony/symfony@11ccd92 · GitHub
[go: up one dir, main page]

Skip to content

Commit 11ccd92 10000

Browse files
committed
#25187 Lookup php binary in PHP_BINDIR first
1 parent 37baa1d commit 11ccd92

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Symfony/Component/Process/PhpExecutableFinder.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,19 @@ public function find($includeArgs = true)
6262
}
6363
}
6464

65-
$dirs = array(PHP_BINDIR);
65+
$dirs = array();
6666
if ('\\' === DIRECTORY_SEPARATOR) {
6767
$dirs[] = 'C:\xampp\php\\';
6868
}
6969

70+
$name = 'php';
71+
foreach (array('', '.exe', '.bat', '.cmd', '.com') as $suffix) {
72+
if (@is_file($file = PHP_BINDIR.DIRECTORY_SEPARATOR.$name.$suffix) &&
73+
('\\' === DIRECTORY_SEPARATOR || is_executable($file))) {
74+
return $file;
75+
}
76+
}
77+
7078
return $this->executableFinder->find('php', false, $dirs);
7179
}
7280

0 commit comments

Comments
 (0)
0