use value of DIRECTORY_SEPARATOR to detect Windows
This commit unifies the detection of Windows builds across the Symfony codebase.
This commit is contained in:
parent
563f9476df
commit
f38a72a2fb
@ -84,7 +84,7 @@ EOT;
|
||||
EOT;
|
||||
|
||||
$errorMessage = 'An error occurred';
|
||||
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
|
||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||
$successOutputProcessDebug = str_replace("'", '"', $successOutputProcessDebug);
|
||||
}
|
||||
|
||||
|
@ -286,7 +286,7 @@ class Filesystem
|
||||
*/
|
||||
public function symlink($originDir, $targetDir, $copyOnWindows = false)
|
||||
{
|
||||
if (defined('PHP_WINDOWS_VERSION_MAJOR') && $copyOnWindows) {
|
||||
if ('\\' === DIRECTORY_SEPARATOR && $copyOnWindows) {
|
||||
$this->mirror($originDir, $targetDir);
|
||||
|
||||
return;
|
||||
|
@ -59,7 +59,7 @@ class FilesystemTest extends FilesystemTestCase
|
||||
public function testCopyUnreadableFileFails()
|
||||
{
|
||||
// skip test on Windows; PHP can't easily set file as unreadable on Windows
|
||||
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
|
||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||
$this->markTestSkipped('This test cannot run on Windows.');
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ class FilesystemTest extends FilesystemTestCase
|
||||
public function testCopyWithOverrideWithReadOnlyTargetFails()
|
||||
{
|
||||
// skip test on Windows; PHP can't easily set file as unwritable on Windows
|
||||
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
|
||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||
$this->markTestSkipped('This test cannot run on Windows.');
|
||||
}
|
||||
|
||||
|
@ -1249,7 +1249,7 @@ class Process
|
||||
*/
|
||||
private function getDescriptors()
|
||||
{
|
||||
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
|
||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||
$this->processPipes = WindowsPipes::create($this, $this->input);
|
||||
} else {
|
||||
$this->processPipes = UnixPipes::create($this, $this->input);
|
||||
|
@ -52,7 +52,7 @@ class CliDumper extends AbstractDumper
|
||||
{
|
||||
parent::__construct($output);
|
||||
|
||||
if (defined('PHP_WINDOWS_VERSION_MAJOR') && false !== @getenv('ANSICON')) {
|
||||
if ('\\' === DIRECTORY_SEPARATOR && false !== @getenv('ANSICON')) {
|
||||
// Use only the base 16 xterm colors when using ANSICON
|
||||
$this->setStyles(array(
|
||||
'default' => '31',
|
||||
@ -394,7 +394,7 @@ class CliDumper extends AbstractDumper
|
||||
}
|
||||
}
|
||||
|
||||
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
|
||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||
static::$defaultColors = @(false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI'));
|
||||
} elseif (function_exists('posix_isatty')) {
|
||||
$h = stream_get_meta_data($this->outputStream) + array('wrapper_type' => null);
|
||||
|
Reference in New Issue
Block a user