-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[2.3][Process] fix Proccess run with pts enabled #16510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Revert "fix cs"
This reverts commit c4cf1c6.
- Loading branch information
commit 1925ba0eb51cb178231f216fbc9bc8e8caff2f54
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd ref https://bugs.php.net/69442 instead |
||
$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 | ||
*/ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to ref this one in the code