From ecd09c74996ecb6e9d5f7f9632544a5c2639e932 Mon Sep 17 00:00:00 2001 From: Evgeniy Sokolov Date: Tue, 10 Nov 2015 01:31:08 +0100 Subject: [PATCH 1/6] fix Proccess run with pts enabled --- src/Symfony/Component/Process/Process.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 1249962bb5a6..c54ac1f90099 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -238,8 +238,21 @@ public function start($callback = null) } } + $ptsWorkaround = null; + + if (!$this->useFileHandles && $this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { + // Workaround for the bug, when PTS functionality is enabled. + // @see : https://github.com/symfony/symfony/issues/12643 + // @see : https://github.com/php/php-src/pull/1588 + $ptsWorkaround = fopen("php://fd/0", "r"); + } + $this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $this->env, $this->options); + if ($ptsWorkaround) { + fclose($ptsWorkaround); + } + if (!is_resource($this->process)) { throw new RuntimeException('Unable to launch a new process.'); } From c4cf1c6692b2e5610908a43d4695b068e57feecf Mon Sep 17 00:00:00 2001 From: Evgeniy Sokolov Date: Tue, 10 Nov 2015 01:34:32 +0100 Subject: [PATCH 2/6] fix cs --- src/Symfony/Component/Process/Process.php | 41 ++++++++++++----------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index c54ac1f90099..dc39dcc79964 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -119,12 +119,12 @@ class Process /** * Constructor. * - * @param string $commandline The command line to run - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to inherit - * @param string|null $stdin The STDIN content - * @param integer|float|null $timeout The timeout in seconds or null to disable - * @param array $options An array of options for proc_open + * @param string $commandline The command line to run + * @param string|null $cwd The working directory or null to use the working dir of the current PHP process + * @param array|null $env The environment variables or null to inherit + * @param string|null $stdin The STDIN content + * @param int|float|null $timeout The timeout in seconds or null to disable + * @param array $options An array of options for proc_open * * @throws RuntimeException When proc_open is not installed * @@ -184,7 +184,7 @@ public function __clone() * @param callback|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR * - * @return integer The exit status code + * @return int The exit status code * * @throws RuntimeException When process can't be launch or is stopped * @@ -244,7 +244,7 @@ public function start($callback = null) // Workaround for the bug, when PTS functionality is enabled. // @see : https://github.com/symfony/symfony/issues/12643 // @see : https://github.com/php/php-src/pull/1588 - $ptsWorkaround = fopen("php://fd/0", "r"); + $ptsWorkaround = fopen('php://fd/0', 'r'); } $this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $this->env, $this->options); @@ -300,7 +300,7 @@ public function restart($callback = null) * * @param callback|null $callback A valid PHP callback * - * @return integer The exitcode of the process + * @return int The exitcode of the process * * @throws RuntimeException When process timed out * @throws RuntimeException When process stopped after receiving signal @@ -315,7 +315,7 @@ public function wait($callback = null) do { $this->checkTimeout(); $running = defined('PHP_WINDOWS_VERSION_BUILD') ? $this->isRunning() : $this->processPipes->hasOpenHandles(); - $close = !defined('PHP_WINDOWS_VERSION_BUILD') || !$running;; + $close = !defined('PHP_WINDOWS_VERSION_BUILD') || !$running; $this->readPipes(true, $close); } while ($running); @@ -337,7 +337,7 @@ public function wait($callback = null) /** * Returns the Pid (process identifier), if applicable. * - * @return integer|null The process id if running, null otherwise + * @return int|null The process id if running, null otherwise * * @throws RuntimeException In case --enable-sigchild is activated */ @@ -355,7 +355,8 @@ public function getPid() /** * Sends a posix signal to the process. * - * @param integer $signal A valid posix signal (see http://www.php.net/manual/en/pcntl.constants.php) + * @param int $signal A valid posix signal (see http://www.php.net/manual/en/pcntl.constants.php) + * * @return Process * * @throws LogicException In case the process is not running @@ -447,7 +448,7 @@ public function getIncrementalErrorOutput() /** * Returns the exit code returned by the process. * - * @return integer The exit status code + * @return int The exit status code * * @throws RuntimeException In case --enable-sigchild is activated and the sigchild compatibility mode is disabled * @@ -521,7 +522,7 @@ public function hasBeenSignaled() * * It is only meaningful if hasBeenSignaled() returns true. * - * @return integer + * @return int * * @throws RuntimeException In case --enable-sigchild is activated * @@ -559,7 +560,7 @@ public function hasBeenStopped() * * It is only meaningful if hasBeenStopped() returns true. * - * @return integer + * @return int * * @api */ @@ -625,10 +626,10 @@ public function getStatus() /** * Stops the process. * - * @param integer|float $timeout The timeout in seconds - * @param integer $signal A posix signal to send in case the process has not stop at timeout, default is SIGKILL + * @param int|float $timeout The timeout in seconds + * @param int $signal A posix signal to send in case the process has not stop at timeout, default is SIGKILL * - * @return integer The exit-code of the process + * @return int The exit-code of the process * * @throws RuntimeException if the process got signaled */ @@ -717,7 +718,7 @@ public function getTimeout() * * To disable the timeout, set this value to null. * - * @param integer|float|null $timeout The timeout in seconds + * @param int|float|null $timeout The timeout in seconds * * @return self The current Process instance * @@ -741,7 +742,7 @@ public function setTimeout($timeout) /** * Enables or disables the TTY mode. * - * @param boolean $tty True to enabled and false to disable + * @param bool $tty True to enabled and false to disable * * @return self The current Process instance */ From 1925ba0eb51cb178231f216fbc9bc8e8caff2f54 Mon Sep 17 00:00:00 2001 From: Evgeniy Sokolov Date: Tue, 10 Nov 2015 01:37:00 +0100 Subject: [PATCH 3/6] Revert "fix cs" This reverts commit c4cf1c6692b2e5610908a43d4695b068e57feecf. --- src/Symfony/Component/Process/Process.php | 41 +++++++++++------------ 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index dc39dcc79964..c54ac1f90099 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -119,12 +119,12 @@ class Process /** * Constructor. * - * @param string $commandline The command line to run - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to inherit - * @param string|null $stdin The STDIN content - * @param int|float|null $timeout The timeout in seconds or null to disable - * @param array $options An array of options for proc_open + * @param string $commandline The command line to run + * @param string|null $cwd The working directory or null to use the working dir of the current PHP process + * @param array|null $env The environment variables or null to inherit + * @param string|null $stdin The STDIN content + * @param integer|float|null $timeout The timeout in seconds or null to disable + * @param array $options An array of options for proc_open * * @throws RuntimeException When proc_open is not installed * @@ -184,7 +184,7 @@ public function __clone() * @param callback|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR * - * @return int The exit status code + * @return integer The exit status code * * @throws RuntimeException When process can't be launch or is stopped * @@ -244,7 +244,7 @@ public function start($callback = null) // Workaround for the bug, when PTS functionality is enabled. // @see : https://github.com/symfony/symfony/issues/12643 // @see : https://github.com/php/php-src/pull/1588 - $ptsWorkaround = fopen('php://fd/0', 'r'); + $ptsWorkaround = fopen("php://fd/0", "r"); } $this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $this->env, $this->options); @@ -300,7 +300,7 @@ public function restart($callback = null) * * @param callback|null $callback A valid PHP callback * - * @return int The exitcode of the process + * @return integer The exitcode of the process * * @throws RuntimeException When process timed out * @throws RuntimeException When process stopped after receiving signal @@ -315,7 +315,7 @@ public function wait($callback = null) do { $this->checkTimeout(); $running = defined('PHP_WINDOWS_VERSION_BUILD') ? $this->isRunning() : $this->processPipes->hasOpenHandles(); - $close = !defined('PHP_WINDOWS_VERSION_BUILD') || !$running; + $close = !defined('PHP_WINDOWS_VERSION_BUILD') || !$running;; $this->readPipes(true, $close); } while ($running); @@ -337,7 +337,7 @@ public function wait($callback = null) /** * Returns the Pid (process identifier), if applicable. * - * @return int|null The process id if running, null otherwise + * @return integer|null The process id if running, null otherwise * * @throws RuntimeException In case --enable-sigchild is activated */ @@ -355,8 +355,7 @@ public function getPid() /** * Sends a posix signal to the process. * - * @param int $signal A valid posix signal (see http://www.php.net/manual/en/pcntl.constants.php) - * + * @param integer $signal A valid posix signal (see http://www.php.net/manual/en/pcntl.constants.php) * @return Process * * @throws LogicException In case the process is not running @@ -448,7 +447,7 @@ public function getIncrementalErrorOutput() /** * Returns the exit code returned by the process. * - * @return int The exit status code + * @return integer The exit status code * * @throws RuntimeException In case --enable-sigchild is activated and the sigchild compatibility mode is disabled * @@ -522,7 +521,7 @@ public function hasBeenSignaled() * * It is only meaningful if hasBeenSignaled() returns true. * - * @return int + * @return integer * * @throws RuntimeException In case --enable-sigchild is activated * @@ -560,7 +559,7 @@ public function hasBeenStopped() * * It is only meaningful if hasBeenStopped() returns true. * - * @return int + * @return integer * * @api */ @@ -626,10 +625,10 @@ public function getStatus() /** * Stops the process. * - * @param int|float $timeout The timeout in seconds - * @param int $signal A posix signal to send in case the process has not stop at timeout, default is SIGKILL + * @param integer|float $timeout The timeout in seconds + * @param integer $signal A posix signal to send in case the process has not stop at timeout, default is SIGKILL * - * @return int The exit-code of the process + * @return integer The exit-code of the process * * @throws RuntimeException if the process got signaled */ @@ -718,7 +717,7 @@ public function getTimeout() * * To disable the timeout, set this value to null. * - * @param int|float|null $timeout The timeout in seconds + * @param integer|float|null $timeout The timeout in seconds * * @return self The current Process instance * @@ -742,7 +741,7 @@ public function setTimeout($timeout) /** * Enables or disables the TTY mode. * - * @param bool $tty True to enabled and false to disable + * @param boolean $tty True to enabled and false to disable * * @return self The current Process instance */ From 74032ab24a3a6990b1be913982e5831c3973dc2d Mon Sep 17 00:00:00 2001 From: Evgeniy Sokolov Date: Tue, 10 Nov 2015 01:38:15 +0100 Subject: [PATCH 4/6] fix cs --- src/Symfony/Component/Process/Process.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index c54ac1f90099..c8ae0144a4b1 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -244,7 +244,7 @@ public function start($callback = null) // Workaround for the bug, when PTS functionality is enabled. // @see : https://github.com/symfony/symfony/issues/12643 // @see : https://github.com/php/php-src/pull/1588 - $ptsWorkaround = fopen("php://fd/0", "r"); + $ptsWorkaround = fopen('php://fd/0', 'r'); } $this->process = proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $this->env, $this->options); From d669a8bc72e410982b0032d271d310cd94320cad Mon Sep 17 00:00:00 2001 From: Evgeniy Sokolov Date: Tue, 10 Nov 2015 11:37:34 +0100 Subject: [PATCH 5/6] change linked bug --- src/Symfony/Component/Process/Process.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index c8ae0144a4b1..b79980114b8a 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -242,8 +242,7 @@ public function start($callback = null) if (!$this->useFileHandles && $this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { // Workaround for the bug, when PTS functionality is enabled. - // @see : https://github.com/symfony/symfony/issues/12643 - // @see : https://github.com/php/php-src/pull/1588 + // @see : https://bugs.php.net/69442 $ptsWorkaround = fopen('php://fd/0', 'r'); } From 90a6c534094c0a8d91fecfaf681964ef409d75e0 Mon Sep 17 00:00:00 2001 From: Evgeniy Sokolov Date: Tue, 10 Nov 2015 11:38:29 +0100 Subject: [PATCH 6/6] fix cs --- src/Symfony/Component/Process/Process.php | 39 ++++++++++++----------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index b79980114b8a..bbafb4327912 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -119,12 +119,12 @@ class Process /** * Constructor. * - * @param string $commandline The command line to run - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to inherit - * @param string|null $stdin The STDIN content - * @param integer|float|null $timeout The timeout in seconds or null to disable - * @param array $options An array of options for proc_open + * @param string $commandline The command line to run + * @param string|null $cwd The working directory or null to use the working dir of the current PHP process + * @param array|null $env The environment variables or null to inherit + * @param string|null $stdin The STDIN content + * @param int|float|null $timeout The timeout in seconds or null to disable + * @param array $options An array of options for proc_open * * @throws RuntimeException When proc_open is not installed * @@ -184,7 +184,7 @@ public function __clone() * @param callback|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR * - * @return integer The exit status code + * @return int The exit status code * * @throws RuntimeException When process can't be launch or is stopped * @@ -299,7 +299,7 @@ public function restart($callback = null) * * @param callback|null $callback A valid PHP callback * - * @return integer The exitcode of the process + * @return int The exitcode of the process * * @throws RuntimeException When process timed out * @throws RuntimeException When process stopped after receiving signal @@ -314,7 +314,7 @@ public function wait($callback = null) do { $this->checkTimeout(); $running = defined('PHP_WINDOWS_VERSION_BUILD') ? $this->isRunning() : $this->processPipes->hasOpenHandles(); - $close = !defined('PHP_WINDOWS_VERSION_BUILD') || !$running;; + $close = !defined('PHP_WINDOWS_VERSION_BUILD') || !$running; $this->readPipes(true, $close); } while ($running); @@ -336,7 +336,7 @@ public function wait($callback = null) /** * Returns the Pid (process identifier), if applicable. * - * @return integer|null The process id if running, null otherwise + * @return int|null The process id if running, null otherwise * * @throws RuntimeException In case --enable-sigchild is activated */ @@ -354,7 +354,8 @@ public function getPid() /** * Sends a posix signal to the process. * - * @param integer $signal A valid posix signal (see http://www.php.net/manual/en/pcntl.constants.php) + * @param int $signal A valid posix signal (see http://www.php.net/manual/en/pcntl.constants.php) + * * @return Process * * @throws LogicException In case the process is not running @@ -446,7 +447,7 @@ public function getIncrementalErrorOutput() /** * Returns the exit code returned by the process. * - * @return integer The exit status code + * @return int The exit status code * * @throws RuntimeException In case --enable-sigchild is activated and the sigchild compatibility mode is disabled * @@ -520,7 +521,7 @@ public function hasBeenSignaled() * * It is only meaningful if hasBeenSignaled() returns true. * - * @return integer + * @return int * * @throws RuntimeException In case --enable-sigchild is activated * @@ -558,7 +559,7 @@ public function hasBeenStopped() * * It is only meaningful if hasBeenStopped() returns true. * - * @return integer + * @return int * * @api */ @@ -624,10 +625,10 @@ public function getStatus() /** * Stops the process. * - * @param integer|float $timeout The timeout in seconds - * @param integer $signal A posix signal to send in case the process has not stop at timeout, default is SIGKILL + * @param int|float $timeout The timeout in seconds + * @param int $signal A posix signal to send in case the process has not stop at timeout, default is SIGKILL * - * @return integer The exit-code of the process + * @return int The exit-code of the process * * @throws RuntimeException if the process got signaled */ @@ -716,7 +717,7 @@ public function getTimeout() * * To disable the timeout, set this value to null. * - * @param integer|float|null $timeout The timeout in seconds + * @param int|float|null $timeout The timeout in seconds * * @return self The current Process instance * @@ -740,7 +741,7 @@ public function setTimeout($timeout) /** * Enables or disables the TTY mode. * - * @param boolean $tty True to enabled and false to disable + * @param bool $tty True to enabled and false to disable * * @return self The current Process instance */ pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy