Skip to content

Commit 0bf19b8

Browse files
committed
use value of DIRECTORY_SEPARATOR to detect Windows
This commit unifies the detection of Windows builds across the Symfony codebase.
1 parent 4ddec2e commit 0bf19b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Dumper/CliDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __construct($output = null)
5252
{
5353
parent::__construct($output);
5454

55-
if (defined('PHP_WINDOWS_VERSION_MAJOR') && false !== @getenv('ANSICON')) {
55+
if ('\\' === DIRECTORY_SEPARATOR && false !== @getenv('ANSICON')) {
5656
// Use only the base 16 xterm colors when using ANSICON
5757
$this->setStyles(array(
5858
'default' => '31',
@@ -394,7 +394,7 @@ protected function supportsColors()
394394
}
395395
}
396396

397-
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
397+
if ('\\' === DIRECTORY_SEPARATOR) {
398398
static::$defaultColors = @(false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI'));
399399
} elseif (function_exists('posix_isatty')) {
400400
$h = stream_get_meta_data($this->outputStream) + array('wrapper_type' => null);

0 commit comments

Comments
 (0)