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+
This commit is contained in:
commit
1c58dcf949
@ -161,7 +161,8 @@ class DeprecationErrorHandler
|
|||||||
{
|
{
|
||||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||||
return
|
return
|
||||||
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
|
defined('STDOUT') && function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(STDOUT)
|
||||||
|
|| '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
|
||||||
|| false !== getenv('ANSICON')
|
|| false !== getenv('ANSICON')
|
||||||
|| 'ON' === getenv('ConEmuANSI')
|
|| 'ON' === getenv('ConEmuANSI')
|
||||||
|| 'xterm' === getenv('TERM');
|
|| 'xterm' === getenv('TERM');
|
||||||
|
@ -90,7 +90,8 @@ class StreamOutput extends Output
|
|||||||
{
|
{
|
||||||
if (DIRECTORY_SEPARATOR === '\\') {
|
if (DIRECTORY_SEPARATOR === '\\') {
|
||||||
return
|
return
|
||||||
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
|
function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support($this->stream)
|
||||||
|
|| '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
|
||||||
|| false !== getenv('ANSICON')
|
|| false !== getenv('ANSICON')
|
||||||
|| 'ON' === getenv('ConEmuANSI')
|
|| 'ON' === getenv('ConEmuANSI')
|
||||||
|| 'xterm' === getenv('TERM');
|
|| 'xterm' === getenv('TERM');
|
||||||
|
@ -450,7 +450,8 @@ class CliDumper extends AbstractDumper
|
|||||||
|
|
||||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||||
static::$defaultColors = @(
|
static::$defaultColors = @(
|
||||||
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
|
function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support($this->outputStream)
|
||||||
|
|| '10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
|
||||||
|| false !== getenv('ANSICON')
|
|| false !== getenv('ANSICON')
|
||||||
|| 'ON' === getenv('ConEmuANSI')
|
|| 'ON' === getenv('ConEmuANSI')
|
||||||
|| 'xterm' === getenv('TERM')
|
|| 'xterm' === getenv('TERM')
|
||||||
|
Reference in New Issue
Block a user