Skip to content

Commit 39e4f04

Browse files
Merge branch '7.0' into 7.1
* 7.0: Skip Twig v3.9-dev for now [Validator] Update Dutch (nl) translation Update Albanian translations [Validator] Update translation [FrameworkBundle] Prevent silenced warning by checking if /proc/mount exists [VarDumper][PhpUnitBridge] Fix color detection prevent throwing NOT_FOUND error when tube is empty [Validator] Update missing validator translation for Swedish [FrameworkBundle] Fix eager-loading of env vars in ConfigBuilderCacheWarmer [Messenger] Fix failing Redis test [Validator] Update Italian (it) translations [Validator] Missing translations for Hungarian (hu) #53769 revert to native PHP union types [Validator] Missing translations for Russian (ru) #53775 fix syntax errors on PHP 7
2 parents 97b6064 + b5c7fc9 commit 39e4f04

File tree

24 files changed

+164
-183
lines changed

24 files changed

+164
-183
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"ext-xml": "*",
4040
"doctrine/event-manager": "^2",
4141
"doctrine/persistence": "^3.1",
42-
"twig/twig": "^3.0.4",
42+
"twig/twig": "~3.8.0",
4343
"psr/cache": "^2.0|^3.0",
4444
"psr/clock": "^1.0",
4545
"psr/container": "^1.1|^2.0",

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -400,29 +400,29 @@ private static function hasColorSupport(): bool
400400
return false;
401401
}
402402

403-
if ('Hyper' === getenv('TERM_PROGRAM')) {
403+
// Detect msysgit/mingw and assume this is a tty because detection
404+
// does not work correctly, see https://github.com/composer/composer/issues/9690
405+
if (!@stream_isatty($stream) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) {
404406
return true;
405407
}
406408

407-
if (\DIRECTORY_SEPARATOR === '\\') {
408-
return (\function_exists('sapi_windows_vt100_support')
409-
&& sapi_windows_vt100_support(\STDOUT))
410-
|| false !== getenv('ANSICON')
411-
|| 'ON' === getenv('ConEmuANSI')
412-
|| 'xterm' === getenv('TERM');
409+
if ('\\' === \DIRECTORY_SEPARATOR && @sapi_windows_vt100_support(\STDOUT)) {
410+
return true;
413411
}
414412

415-
if (\function_exists('stream_isatty')) {
416-
return @stream_isatty(\STDOUT);
413+
if ('Hyper' === getenv('TERM_PROGRAM')
414+
|| false !== getenv('COLORTERM')
415+
|| false !== getenv('ANSICON')
416+
|| 'ON' === getenv('ConEmuANSI')
417+
) {
418+
return true;
417419
}
418420

419-
if (\function_exists('posix_isatty')) {
420-
return @posix_isatty(\STDOUT);
421+
if ('dumb' === $term = (string) getenv('TERM')) {
422+
return false;
421423
}
422424

423-
$stat = fstat(\STDOUT);
424-
425-
// Check if formatted mode is S_IFCHR
426-
return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
425+
// See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157
426+
return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term);
427427
}
428428
}

src/Symfony/Bridge/Twig/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=8.2",
2020
"symfony/translation-contracts": "^2.5|^3",
21-
"twig/twig": "^3.0.4|^4.0"
21+
"twig/twig": "~3.8.0"
2222
},
2323
"require-dev": {
2424
"egulias/email-validator": "^2.1.10|^3|^4",

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/ConfigBuilderCacheWarmer.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
use Symfony\Component\Config\Builder\ConfigBuilderGenerator;
1616
use Symfony\Component\Config\Builder\ConfigBuilderGeneratorInterface;
1717
use Symfony\Component\Config\Definition\ConfigurationInterface;
18+
use Symfony\Component\DependencyInjection\Container;
1819
use Symfony\Component\DependencyInjection\ContainerBuilder;
1920
use Symfony\Component\DependencyInjection\Extension\ConfigurationExtensionInterface;
2021
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
22+
use Symfony\Component\DependencyInjection\ParameterBag\ContainerBag;
23+
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
2124
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface;
2225
use Symfony\Component\HttpKernel\KernelInterface;
2326

@@ -70,7 +73,8 @@ private function dumpExtension(ExtensionInterface $extension, ConfigBuilderGener
7073
if ($extension instanceof ConfigurationInterface) {
7174
$configuration = $extension;
7275
} elseif ($extension instanceof ConfigurationExtensionInterface) {
73-
$configuration = $extension->getConfiguration([], new ContainerBuilder($this->kernel->getContainer()->getParameterBag()));
76+
$container = $this->kernel->getContainer();
77+
$configuration = $extension->getConfiguration([], new ContainerBuilder($container instanceof Container ? new ContainerBag($container) : new ParameterBag()));
7478
}
7579

7680
if (!$configuration) {

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"symfony/uid": "^6.4|^7.0",
7373
"symfony/web-link": "^6.4|^7.0",
7474
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
75-
"twig/twig": "^3.0.4|^4.0"
75+
"twig/twig": "~3.8.0"
7676
},
7777
"conflict": {
7878
"doctrine/persistence": "<1.3",

src/Symfony/Bundle/SecurityBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"symfony/twig-bridge": "^6.4|^7.0",
5151
"symfony/validator": "^6.4|^7.0",
5252
"symfony/yaml": "^6.4|^7.0",
53-
"twig/twig": "^3.0.4|^4.0",
53+
"twig/twig": "~3.8.0",
5454
"web-token/jwt-checker": "^3.1",
5555
"web-token/jwt-signature-algorithm-hmac": "^3.1",
5656
"web-token/jwt-signature-algorithm-ecdsa": "^3.1",

src/Symfony/Bundle/TwigBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"symfony/twig-bridge": "^6.4|^7.0",
2424
"symfony/http-foundation": "^6.4|^7.0",
2525
"symfony/http-kernel": "^6.4|^7.0",
26-
"twig/twig": "^3.0.4|^4.0"
26+
"twig/twig": "~3.8.0"
2727
},
2828
"require-dev": {
2929
"symfony/asset": "^6.4|^7.0",

src/Symfony/Bundle/WebProfilerBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"symfony/http-kernel": "^6.4|^7.0",
2323
"symfony/routing": "^6.4|^7.0",
2424
"symfony/twig-bundle": "^6.4|^7.0",
25-
"twig/twig": "^3.0.4|^4.0"
25+
"twig/twig": "~3.8.0"
2626
},
2727
"require-dev": {
2828
"symfony/browser-kit": "^6.4|^7.0",

src/Symfony/Component/Console/Helper/QuestionHelper.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -490,19 +490,7 @@ private function isInteractiveInput($inputStream): bool
490490
return self::$stdinIsInteractive;
491491
}
492492

493-
if (\function_exists('stream_isatty')) {
494-
return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r'));
495-
}
496-
497-
if (\function_exists('posix_isatty')) {
498-
return self::$stdinIsInteractive = @posix_isatty(fopen('php://stdin', 'r'));
499-
}
500-
501-
if (!\function_exists('shell_exec')) {
502-
return self::$stdinIsInteractive = true;
503-
}
504-
505-
return self::$stdinIsInteractive = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null'));
493+
return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r'));
506494
}
507495

508496
/**

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

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,13 @@ protected function hasColorSupport(): bool
9494
return false;
9595
}
9696

97-
if (!$this->isTty()) {
97+
// Detect msysgit/mingw and assume this is a tty because detection
98+
// does not work correctly, see https://github.com/composer/composer/issues/9690
99+
if (!@stream_isatty($this->stream) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) {
98100
return false;
99101
}
100102

101-
if (\DIRECTORY_SEPARATOR === '\\'
102-
&& \function_exists('sapi_windows_vt100_support')
103-
&& @sapi_windows_vt100_support($this->stream)
104-
) {
103+
if ('\\' === \DIRECTORY_SEPARATOR && @sapi_windows_vt100_support($this->stream)) {
105104
return true;
106105
}
107106

@@ -113,43 +112,11 @@ protected function hasColorSupport(): bool
113112
return true;
114113
}
115114

116-
$term = (string) getenv('TERM');
117-
118-
if ('dumb' === $term) {
115+
if ('dumb' === $term = (string) getenv('TERM')) {
119116
return false;
120117
}
121118

122119
// See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157
123-
return 1 === @preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term);
124-
}
125-
126-
/**
127-
* Checks if the stream is a TTY, i.e; whether the output stream is connected to a terminal.
128-
*
129-
* Reference: Composer\Util\Platform::isTty
130-
* https://github.com/composer/composer
131-
*/
132-
private function isTty(): bool
133-
{
134-
// Detect msysgit/mingw and assume this is a tty because detection
135-
// does not work correctly, see https://github.com/composer/composer/issues/9690
136-
if (\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) {
137-
return true;
138-
}
139-
140-
// Modern cross-platform function, includes the fstat fallback so if it is present we trust it
141-
if (\function_exists('stream_isatty')) {
142-
return stream_isatty($this->stream);
143-
}
144-
145-
// Only trusting this if it is positive, otherwise prefer fstat fallback.
146-
if (\function_exists('posix_isatty') && posix_isatty($this->stream)) {
147-
return true;
148-
}
149-
150-
$stat = @fstat($this->stream);
151-
152-
// Check if formatted mode is S_IFCHR
153-
return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
120+
return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term);
154121
}
155122
}

0 commit comments

Comments
 (0)