From 3c18e3b67ab87d2411daf56aeb4d38e3ce6005a4 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 31 Jan 2018 15:54:50 +0100 Subject: [PATCH 1/3] Documented the PhpExecutableFinder utility --- components/process.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/components/process.rst b/components/process.rst index 670bb9b92ce..75bd8cf3b27 100644 --- a/components/process.rst +++ b/components/process.rst @@ -350,6 +350,22 @@ Use :method:`Symfony\\Component\\Process\\Process::disableOutput` and Moreover, you could not pass a callback to the ``start()``, ``run()`` or ``mustRun()`` methods or use ``setIdleTimeout()``. +Finding the Executable PHP Binary +--------------------------------- + +This component also provides a utility class called +:class:`Symfony\\Component\\Process\\PhpExecutableFinder` which returns the +absolute path of the executable PHP binary available on your server. It looks +for the PHP executable using environment variables like ``PHP_BINARY``, +``PHP_PATH``, ``PHP_PEAR_PHP_BIN``, ``PHP_BINDIR`, etc. and returns the first +available binary:: + + use Symfony\Component\Process\PhpExecutableFinder; + + $phpBinaryFinder = new PhpExecutableFinder(); + $phpBinaryPath = $phpBinaryFinder->find(); + // $phpBinaryPath = '/usr/local/bin/php' (the result will be different on your computer) + .. _`Symfony Issue#5759`: https://github.com/symfony/symfony/issues/5759 .. _`PHP Bug#39992`: https://bugs.php.net/bug.php?id=39992 .. _`exec`: https://en.wikipedia.org/wiki/Exec_(operating_system) From 56dca4c11b2d107a055da2d8f05a65d34dd54433 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 31 Jan 2018 16:00:33 +0100 Subject: [PATCH 2/3] Fixed a syntax issue --- components/process.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/process.rst b/components/process.rst index 75bd8cf3b27..2c27aa4f6b3 100644 --- a/components/process.rst +++ b/components/process.rst @@ -357,7 +357,7 @@ This component also provides a utility class called :class:`Symfony\\Component\\Process\\PhpExecutableFinder` which returns the absolute path of the executable PHP binary available on your server. It looks for the PHP executable using environment variables like ``PHP_BINARY``, -``PHP_PATH``, ``PHP_PEAR_PHP_BIN``, ``PHP_BINDIR`, etc. and returns the first +``PHP_PATH``, ``PHP_PEAR_PHP_BIN``, ``PHP_BINDIR``, etc. and returns the first available binary:: use Symfony\Component\Process\PhpExecutableFinder; From 64ca0fc6d6479be1499bff12878e3cb427384499 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 3 Feb 2018 12:28:16 +0100 Subject: [PATCH 3/3] Removed a phrase that is not accurate --- components/process.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/components/process.rst b/components/process.rst index 2c27aa4f6b3..355c853105f 100644 --- a/components/process.rst +++ b/components/process.rst @@ -355,10 +355,7 @@ Finding the Executable PHP Binary This component also provides a utility class called :class:`Symfony\\Component\\Process\\PhpExecutableFinder` which returns the -absolute path of the executable PHP binary available on your server. It looks -for the PHP executable using environment variables like ``PHP_BINARY``, -``PHP_PATH``, ``PHP_PEAR_PHP_BIN``, ``PHP_BINDIR``, etc. and returns the first -available binary:: +absolute path of the executable PHP binary available on your server:: use Symfony\Component\Process\PhpExecutableFinder;