Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -2,6 +2,12 @@
All notable changes in `sebastianbergmann/environment` are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [5.1.5] - 2023-02-03
### Fixed
* [#59](https://github.com/sebastianbergmann/environment/issues/59): Wrong usage of `stream_isatty()`, `fstat()` used without checking whether the function is available
## [5.1.4] - 2022-04-03
### Fixed
@@ -151,6 +157,7 @@ All notable changes in `sebastianbergmann/environment` are documented in this fi
* This component is no longer supported on PHP 5.6
[5.1.5]: https://github.com/sebastianbergmann/environment/compare/5.1.4...5.1.5
[5.1.4]: https://github.com/sebastianbergmann/environment/compare/5.1.3...5.1.4
[5.1.3]: https://github.com/sebastianbergmann/environment/compare/5.1.2...5.1.3
[5.1.2]: https://github.com/sebastianbergmann/environment/compare/5.1.1...5.1.2

View File

@@ -105,16 +105,14 @@ final class Console
public function isInteractive($fileDescriptor = self::STDOUT): bool
{
if (is_resource($fileDescriptor)) {
// These functions require a descriptor that is a real resource, not a numeric ID of it
if (function_exists('stream_isatty') && @stream_isatty($fileDescriptor)) {
return true;
}
// Check if formatted mode is S_IFCHR
if (function_exists('fstat') && @stream_isatty($fileDescriptor)) {
if (function_exists('fstat')) {
$stat = @fstat(STDOUT);
return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
return $stat && 0020000 === ($stat['mode'] & 0170000);
}
return false;