mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-02 21:19:58 +09:00
Update to laravel 7
This commit is contained in:
29
vendor/symfony/console/Output/StreamOutput.php
vendored
29
vendor/symfony/console/Output/StreamOutput.php
vendored
@@ -12,7 +12,6 @@
|
||||
namespace Symfony\Component\Console\Output;
|
||||
|
||||
use Symfony\Component\Console\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\Console\Exception\RuntimeException;
|
||||
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
|
||||
|
||||
/**
|
||||
@@ -58,7 +57,7 @@ class StreamOutput extends Output
|
||||
/**
|
||||
* Gets the stream attached to this StreamOutput instance.
|
||||
*
|
||||
* @return resource A stream resource
|
||||
* @return resource
|
||||
*/
|
||||
public function getStream()
|
||||
{
|
||||
@@ -68,16 +67,13 @@ class StreamOutput extends Output
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doWrite($message, $newline)
|
||||
protected function doWrite(string $message, bool $newline)
|
||||
{
|
||||
if ($newline) {
|
||||
$message .= PHP_EOL;
|
||||
$message .= \PHP_EOL;
|
||||
}
|
||||
|
||||
if (false === @fwrite($this->stream, $message)) {
|
||||
// should never happen
|
||||
throw new RuntimeException('Unable to write output.');
|
||||
}
|
||||
@fwrite($this->stream, $message);
|
||||
|
||||
fflush($this->stream);
|
||||
}
|
||||
@@ -97,6 +93,11 @@ class StreamOutput extends Output
|
||||
*/
|
||||
protected function hasColorSupport()
|
||||
{
|
||||
// Follow https://no-color.org/
|
||||
if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ('Hyper' === getenv('TERM_PROGRAM')) {
|
||||
return true;
|
||||
}
|
||||
@@ -109,16 +110,6 @@ class StreamOutput extends Output
|
||||
|| 'xterm' === getenv('TERM');
|
||||
}
|
||||
|
||||
if (\function_exists('stream_isatty')) {
|
||||
return @stream_isatty($this->stream);
|
||||
}
|
||||
|
||||
if (\function_exists('posix_isatty')) {
|
||||
return @posix_isatty($this->stream);
|
||||
}
|
||||
|
||||
$stat = @fstat($this->stream);
|
||||
// Check if formatted mode is S_IFCHR
|
||||
return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
|
||||
return stream_isatty($this->stream);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user