8000 bug #25972 support sapi_windows_vt100_support for php 7.2+ (jhdxr) · symfony/symfony@1c58dcf · GitHub
[go: up one dir, main page]

Skip to content

Commit 1c58dcf

Browse files
bug #25972 support sapi_windows_vt100_support for php 7.2+ (jhdxr)
This PR was merged into the 2.7 branch. Discussion ---------- support sapi_windows_vt100_support for php 7.2+ | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | See below | License | MIT | Doc PR | N/A php 7.2 enabled color support on windows(>=10.0.10586) and introduced a new function called `sapi_windows_vt100_support` to get and set the state. this PR add the support for this new function, so users on windows can see the colorful world again with php 7.2+. Commits ------- 5bbb77b support sapi_windows_vt100_support for php 7.2+
2 parents b9bb577 + 5bbb77b commit 1c58dcf

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ private static function hasColorSupport()
161161
{
162162
if ('\\' === DIRECTORY_SEPARATOR) {
163163
return
164-
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
164+
defined('STDOUT') && function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(STDOUT)
165+
|| '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
165166
|| false !== getenv('ANSICON')
166167
|| 'ON' === getenv('ConEmuANSI')
167168
|| 'xterm' === getenv('TERM');

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ protected function hasColorSupport()
9090
{
9191
if (DIRECTORY_SEPARATOR === '\\') {
9292
return
93-
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
93+
function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support($this->stream)
94+
|| '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
9495
|| false !== getenv('ANSICON')
9596
|| 'ON' === getenv('ConEmuANSI')
9697
|| 'xterm' === getenv('TERM');

src/Symfony/Component/VarDumper/Dumper/CliDumper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,8 @@ protected function supportsColors()
450450

451451
if ('\\' === DIRECTORY_SEPARATOR) {
452452
static::$defaultColors = @(
453-
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
453+
function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support($this->outputStream)
454+
|| '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
454455
|| false !== getenv('ANSICON')
455456
|| 'ON' === getenv('ConEmuANSI')
456457
|| 'xterm' === getenv('TERM')

0 commit comments

Comments
 (0)
0