ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
Symfony\Component\Process\PhpExecutableFinder Class Reference

An executable finder specifically designed for the PHP executable. More...

+ Collaboration diagram for Symfony\Component\Process\PhpExecutableFinder:

Public Member Functions

 __construct ()
 
 find ($includeArgs=true)
 Finds The PHP executable. More...
 
 findArguments ()
 Finds the PHP executable arguments. More...
 

Private Attributes

 $executableFinder
 

Detailed Description

An executable finder specifically designed for the PHP executable.

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
Johannes M. Schmitt schmi.nosp@m.ttjo.nosp@m.h@gma.nosp@m.il.c.nosp@m.om

Definition at line 20 of file PhpExecutableFinder.php.

Constructor & Destructor Documentation

◆ __construct()

Symfony\Component\Process\PhpExecutableFinder::__construct ( )

Definition at line 24 of file PhpExecutableFinder.php.

25  {
26  $this->executableFinder = new ExecutableFinder();
27  }

Member Function Documentation

◆ find()

Symfony\Component\Process\PhpExecutableFinder::find (   $includeArgs = true)

Finds The PHP executable.

Parameters
bool$includeArgsWhether or not include command arguments
Returns
string|false The PHP executable path or false if it cannot be found

Definition at line 36 of file PhpExecutableFinder.php.

References $php, array, defined, and Symfony\Component\Process\PhpExecutableFinder\findArguments().

37  {
38  $args = $this->findArguments();
39  $args = $includeArgs && $args ? ' '.implode(' ', $args) : '';
40 
41  // HHVM support
42  if (defined('HHVM_VERSION')) {
43  return (getenv('PHP_BINARY') ?: PHP_BINARY).$args;
44  }
45 
46  // PHP_BINARY return the current sapi executable
47  if (PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg')) && is_file(PHP_BINARY)) {
48  return PHP_BINARY.$args;
49  }
50 
51  if ($php = getenv('PHP_PATH')) {
52  if (!is_executable($php)) {
53  return false;
54  }
55 
56  return $php;
57  }
58 
59  if ($php = getenv('PHP_PEAR_PHP_BIN')) {
60  if (is_executable($php)) {
61  return $php;
62  }
63  }
64 
65  $dirs = array(PHP_BINDIR);
66  if ('\\' === DIRECTORY_SEPARATOR) {
67  $dirs[] = 'C:\xampp\php\\';
68  }
69 
70  return $this->executableFinder->find('php', false, $dirs);
71  }
findArguments()
Finds the PHP executable arguments.
Create styles array
The data for the language used.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
$php
Definition: flush.php:22
+ Here is the call graph for this function:

◆ findArguments()

Symfony\Component\Process\PhpExecutableFinder::findArguments ( )

Finds the PHP executable arguments.

Returns
array The PHP executable arguments

Definition at line 78 of file PhpExecutableFinder.php.

References array, and defined.

Referenced by Symfony\Component\Process\PhpExecutableFinder\find().

79  {
80  $arguments = array();
81 
82  if (defined('HHVM_VERSION')) {
83  $arguments[] = '--php';
84  } elseif ('phpdbg' === PHP_SAPI) {
85  $arguments[] = '-qrr';
86  }
87 
88  return $arguments;
89  }
Create styles array
The data for the language used.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
+ Here is the caller graph for this function:

Field Documentation

◆ $executableFinder

Symfony\Component\Process\PhpExecutableFinder::$executableFinder
private

Definition at line 22 of file PhpExecutableFinder.php.


The documentation for this class was generated from the following file: