minor #13149 [2.6] for consistency, use DIRECTORY_SEPARATOR to detect Windows (xabbuh)
This PR was merged into the 2.6 branch.
Discussion
----------
[2.6] for consistency, use DIRECTORY_SEPARATOR to detect Windows
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
This commit unifies the detection of Windows builds across the Symfony
codebase.
Changes specific to Symfony 2.6 and not part of neither #13147 nor #13148.
Commits
-------
f38a72a
use value of DIRECTORY_SEPARATOR to detect Windows
This commit is contained in:
commit
0cf7318c0a
@ -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