Skip to content

Commit

Permalink
Merge branch '6.4' into 7.0
Browse files Browse the repository at this point in the history
* 6.4:
  Skip Twig v3.9-dev for now
  [Validator] Update Dutch (nl) translation
  Update Albanian translations
  [Validator] Update translation
  [FrameworkBundle] Prevent silenced warning by checking if /proc/mount exists
  [VarDumper][PhpUnitBridge] Fix color detection
  prevent throwing NOT_FOUND error when tube is empty
  [Validator] Update missing validator translation for Swedish
  [FrameworkBundle] Fix eager-loading of env vars in ConfigBuilderCacheWarmer
  [Messenger] Fix failing Redis test
  [Validator] Update Italian (it) translations
  [Validator] Missing translations for Hungarian (hu) #53769
  revert to native PHP union types
  [Validator] Missing translations for Russian (ru) #53775
  fix syntax errors on PHP 7
  • Loading branch information
nicolas-grekas committed Feb 7, 2024
2 parents 0a2eeb0 + 5f3e4ab commit 93c9a82
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions DeprecationErrorHandler.php
Expand Up @@ -400,29 +400,29 @@ private static function hasColorSupport(): bool
return false;
}

if ('Hyper' === getenv('TERM_PROGRAM')) {
// Detect msysgit/mingw and assume this is a tty because detection
// does not work correctly, see https://github.com/composer/composer/issues/9690
if (!@stream_isatty($stream) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) {
return true;
}

if (\DIRECTORY_SEPARATOR === '\\') {
return (\function_exists('sapi_windows_vt100_support')
&& sapi_windows_vt100_support(\STDOUT))
|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM');
if ('\\' === \DIRECTORY_SEPARATOR && @sapi_windows_vt100_support(\STDOUT)) {
return true;
}

if (\function_exists('stream_isatty')) {
return @stream_isatty(\STDOUT);
if ('Hyper' === getenv('TERM_PROGRAM')
|| false !== getenv('COLORTERM')
|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
) {
return true;
}

if (\function_exists('posix_isatty')) {
return @posix_isatty(\STDOUT);
if ('dumb' === $term = (string) getenv('TERM')) {
return false;
}

$stat = fstat(\STDOUT);

// Check if formatted mode is S_IFCHR
return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
// See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157
return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term);
}
}

0 comments on commit 93c9a82

Please sign in to comment.