Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Console][Process] Free process resources #44882

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
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Console: close php://input handle
  • Loading branch information
jtojnar committed Dec 31, 2021
commit 38c35835c90620ec413e831f16e3b73b92d2007b
10 changes: 9 additions & 1 deletion 10 src/Symfony/Component/Console/Cursor.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ final class Cursor
{
private $output;
private $input;
private $inputResource = null;

public function __construct(OutputInterface $output, $input = null)
{
$this->output = $output;
$this->input = $input ?? (\defined('STDIN') ? \STDIN : fopen('php://input', 'r+'));
$this->input = $input ?? (\defined('STDIN') ? \STDIN : $this->inputResource = fopen('php://input', 'r+'));
}

public function moveUp(int $lines = 1): self
Expand Down Expand Up @@ -172,4 +173,11 @@ public function getCurrentPosition(): array

return [$col, $row];
}

public function __destruct()
{
if (null !== $this->inputResource) {
fclose($this->inputResource);
}
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.