mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
N°9319 increase php min. version to 8.2 (#887)
* Update minimum PHP version to 8.2 * Fix previous wrong resolution of merge conflict
This commit is contained in:
@@ -142,12 +142,27 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
|
||||
*/
|
||||
private function openOutputStream()
|
||||
{
|
||||
static $stdout;
|
||||
|
||||
if ($stdout) {
|
||||
return $stdout;
|
||||
}
|
||||
|
||||
if (!$this->hasStdoutSupport()) {
|
||||
return fopen('php://output', 'w');
|
||||
return $stdout = fopen('php://output', 'w');
|
||||
}
|
||||
|
||||
// Use STDOUT when possible to prevent from opening too many file descriptors
|
||||
return \defined('STDOUT') ? \STDOUT : (@fopen('php://stdout', 'w') ?: fopen('php://output', 'w'));
|
||||
if (!\defined('STDOUT')) {
|
||||
return $stdout = @fopen('php://stdout', 'w') ?: fopen('php://output', 'w');
|
||||
}
|
||||
|
||||
// On Windows, STDOUT is opened in text mode; reopen in binary mode to prevent \n to \r\n conversion
|
||||
if ('\\' === \DIRECTORY_SEPARATOR) {
|
||||
return $stdout = @fopen('php://stdout', 'w') ?: \STDOUT;
|
||||
}
|
||||
|
||||
return $stdout = \STDOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -155,11 +170,26 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
|
||||
*/
|
||||
private function openErrorStream()
|
||||
{
|
||||
static $stderr;
|
||||
|
||||
if ($stderr) {
|
||||
return $stderr;
|
||||
}
|
||||
|
||||
if (!$this->hasStderrSupport()) {
|
||||
return fopen('php://output', 'w');
|
||||
return $stderr = fopen('php://output', 'w');
|
||||
}
|
||||
|
||||
// Use STDERR when possible to prevent from opening too many file descriptors
|
||||
return \defined('STDERR') ? \STDERR : (@fopen('php://stderr', 'w') ?: fopen('php://output', 'w'));
|
||||
if (!\defined('STDERR')) {
|
||||
return $stderr = @fopen('php://stderr', 'w') ?: fopen('php://output', 'w');
|
||||
}
|
||||
|
||||
// On Windows, STDERR is opened in text mode; reopen in binary mode to prevent \n → \r\n conversion
|
||||
if ('\\' === \DIRECTORY_SEPARATOR) {
|
||||
return $stderr = @fopen('php://stderr', 'w') ?: \STDERR;
|
||||
}
|
||||
|
||||
return $stderr ??= \STDERR;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user