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

Commit fd7b1b0

Browse filesBrowse files
[Console] use STDOUT/ERR in ConsoleOutput to save opening too many file descriptors
1 parent 99b4885 commit fd7b1b0
Copy full SHA for fd7b1b0

File tree

1 file changed

+6
-2
lines changed
Filter options

1 file changed

+6
-2
lines changed

‎src/Symfony/Component/Console/Output/ConsoleOutput.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Output/ConsoleOutput.php
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,18 @@ private function openOutputStream()
153153
return fopen('php://output', 'w');
154154
}
155155

156-
return @fopen('php://stdout', 'w') ?: fopen('php://output', 'w');
156+
return \defined('STDOUT') ? \STDOUT : (@fopen('php://stdout', 'w') ?: fopen('php://output', 'w'));
157157
}
158158

159159
/**
160160
* @return resource
161161
*/
162162
private function openErrorStream()
163163
{
164-
return fopen($this->hasStderrSupport() ? 'php://stderr' : 'php://output', 'w');
164+
if (!$this->hasStderrSupport()) {
165+
return fopen('php://output', 'w');
166+
}
167+
168+
return \defined('STDERR') ? \STDERR : (@fopen('php://stderr', 'w') ?: fopen('php://output', 'w'));
165169
}
166170
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.