PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / trunk
Matomo Analytics – Powerful, Privacy-First Insights for WordPress vtrunk
5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / vendor / symfony / process / PhpExecutableFinder.php
matomo / app / vendor / symfony / process Last commit date
Exception 1 year ago Pipes 1 year ago ExecutableFinder.php 1 year ago InputStream.php 1 year ago LICENSE 1 year ago PhpExecutableFinder.php 1 year ago PhpProcess.php 1 year ago Process.php 3 months ago ProcessUtils.php 1 year ago README.md 1 year ago
PhpExecutableFinder.php
82 lines
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11 namespace Symfony\Component\Process;
12
13 /**
14 * An executable finder specifically designed for the PHP executable.
15 *
16 * @author Fabien Potencier <fabien@symfony.com>
17 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
18 */
19 class PhpExecutableFinder
20 {
21 private $executableFinder;
22 public function __construct()
23 {
24 $this->executableFinder = new \Symfony\Component\Process\ExecutableFinder();
25 }
26 /**
27 * Finds The PHP executable.
28 *
29 * @return string|false
30 */
31 public function find(bool $includeArgs = \true)
32 {
33 if ($php = getenv('PHP_BINARY')) {
34 if (!is_executable($php) && !($php = $this->executableFinder->find($php))) {
35 return \false;
36 }
37 if (@is_dir($php)) {
38 return \false;
39 }
40 return $php;
41 }
42 $args = $this->findArguments();
43 $args = $includeArgs && $args ? ' ' . implode(' ', $args) : '';
44 // PHP_BINARY return the current sapi executable
45 if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cli', 'cli-server', 'phpdbg'], \true)) {
46 return \PHP_BINARY . $args;
47 }
48 if ($php = getenv('PHP_PATH')) {
49 if (!@is_executable($php) || @is_dir($php)) {
50 return \false;
51 }
52 return $php;
53 }
54 if ($php = getenv('PHP_PEAR_PHP_BIN')) {
55 if (@is_executable($php) && !@is_dir($php)) {
56 return $php;
57 }
58 }
59 if (@is_executable($php = \PHP_BINDIR . ('\\' === \DIRECTORY_SEPARATOR ? '\\php.exe' : '/php')) && !@is_dir($php)) {
60 return $php;
61 }
62 $dirs = [\PHP_BINDIR];
63 if ('\\' === \DIRECTORY_SEPARATOR) {
64 $dirs[] = 'C:\\xampp\\php\\';
65 }
66 return $this->executableFinder->find('php', \false, $dirs);
67 }
68 /**
69 * Finds the PHP executable arguments.
70 *
71 * @return array
72 */
73 public function findArguments()
74 {
75 $arguments = [];
76 if ('phpdbg' === \PHP_SAPI) {
77 $arguments[] = '-qrr';
78 }
79 return $arguments;
80 }
81 }
82