8000 Merge branch '5.4' into 6.4 · symfony/symfony@2868d0d · GitHub
[go: up one dir, main page]

Skip to content

Commit 2868d0d

Browse files
Merge branch '5.4' into 6.4
* 5.4: 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
2 parents 7cda7b4 + fa7531f commit 2868d0d

File tree

23 files changed

+182
-147
lines changed

23 files changed

+182
-147
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"friendsofphp/proxy-manager-lts": "^1.0.2",
4141
"doctrine/event-manager": "^1.2|^2",
4242
"doctrine/persistence": "^3.1",
43-
"twig/twig": "^2.13|^3.0.4",
43+
"twig/twig": "^2.13|~3.8.0",
4444
"psr/cache": "^2.0|^3.0",
4545
"psr/clock": "^1.0",
4646
"psr/container": "^1.1|^2.0",

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -411,27 +411,58 @@ private static function hasColorSupport()
411411
return false;
412412
}
413413

414-
if ('Hyper' === getenv('TERM_PROGRAM')) {
414+
if (!self::isTty()) {
415415
return true;
416416
}
417417

418-
if (\DIRECTORY_SEPARATOR === '\\') {
419-
return (\function_exists('sapi_windows_vt100_support')
420-
&& sapi_windows_vt100_support(\STDOUT))
421-
|| false !== getenv('ANSICON')
422-
|| 'ON' === getenv('ConEmuANSI')
423-
|| 'xterm' === getenv('TERM');
418+
if ('\\' === \DIRECTORY_SEPARATOR
419+
&& \function_exists('sapi_windows_vt100_support')
420+
&& @sapi_windows_vt100_support(\STDOUT)
421+
) {
422+
return true;
424423
}
425424

425+
if ('Hyper' === getenv('TERM_PROGRAM')
426+
|| false !== getenv('COLORTERM')
427+
|| false !== getenv('ANSICON')
428+
|| 'ON' === getenv('ConEmuANSI')
429+
) {
430+
return true;
431+
}
432+
433+
if ('dumb' === $term = (string) getenv('TERM')) {
434+
return false;
435+
}
436+
437+
// See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157
438+
return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term);
439+
}
440+
441+
/**
442+
* Checks if the stream is a TTY, i.e; whether the output stream is connected to a terminal.
443+
*
444+
* Reference: Composer\Util\Platform::isTty
445+
* https://github.com/composer/composer
446+
*/
447+
private static function isTty(): bool
448+
{
449+
// Detect msysgit/mingw and assume this is a tty because detection
450+
// does not work correctly, see https://github.com/composer/composer/issues/9690
451+
if (\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) {
452+
return true;
453+
}
454+
455+
// Modern cross-platform function, includes the fstat fallback so if it is present we trust it
426456
if (\function_exists('stream_isatty')) {
427457
return @stream_isatty(\STDOUT);
428458
}
429459

430-
if (\function_exists('posix_isatty')) {
431-
return @posix_isatty(\STDOUT);
460+
// Only trusting this if it is positive, otherwise prefer fstat fallback.
461+
if (\function_exists('posix_isatty') && @posix_isatty(\STDOUT)) {
462+
return true;
432463
}
433464

434-
$stat = fstat(\STDOUT);
465+
$stat = @fstat(\STDOUT);
435466

436467
// Check if formatted mode is S_IFCHR
437468
return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;

src/Symfony/Bridge/Twig/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"php": ">=8.1",
2020
"symfony/deprecation-contracts": "^2.5|^3",
2121
"symfony/translation-contracts": "^2.5|^3",
22-
"twig/twig": "^2.13|^3.0.4"
22+
"twig/twig": "^2.13|~3.8.0"
2323
},
2424
"require-dev": {
2525
"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

@@ -73,7 +76,8 @@ private function dumpExtension(ExtensionInterface $extension, ConfigBuilderGener
7376
if ($extension instanceof ConfigurationInterface) {
7477
$configuration = $extension;
7578
} elseif ($extension instanceof ConfigurationExtensionInterface) {
76-
$configuration = $extension->getConfiguration([], new ContainerBuilder($this->kernel->getContainer()->getParameterBag()));
79+
$container = $this->kernel->getContainer();
80+
$configuration = $extension->getConfiguration([], new ContainerBuilder($container instanceof Container ? new ContainerBag($container) : new ParameterBag()));
7781
}
7882

7983
if (!$configuration) {

src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ private function isNfs(string $dir): bool
200200

201201
if (null === $mounts) {
202202
$mounts = [];
203-
if ('/' === \DIRECTORY_SEPARATOR && $files = @file('/proc/mounts')) {
203+
if ('/' === \DIRECTORY_SEPARATOR && is_readable('/proc/mounts') && $files = @file('/proc/mounts')) {
204204
foreach ($files as $mount) {
205205
$mount = \array_slice(explode(' ', $mount), 1, -3);
206206
if (!\in_array(array_pop($mount), ['vboxsf', 'nfs'])) {

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": "^5.4|^6.0|^7.0",
7373
"symfony/web-link": "^5.4|^6.0|^7.0",
7474
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
75-
"twig/twig": "^2.10|^3.0"
75+
"twig/twig": "^2.10|~3.8.0"
7676
},
7777
"conflict": {
7878
"doctrine/annotations": "<1.13.1",

src/Symfony/Bundle/SecurityBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"symfony/twig-bridge": "^5.4|^6.0|^7.0",
5252
"symfony/validator": "^6.4|^7.0",
5353
"symfony/yaml": "^5.4|^6.0|^7.0",
54-
"twig/twig": "^2.13|^3.0.4",
54+
"twig/twig": "^2.13|~3.8.0",
5555
"web-token/jwt-checker": "^3.1",
5656
"web-token/jwt-signature-algorithm-hmac": "^3.1",
5757
"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",
2424
"symfony/http-foundation": "^5.4|^6.0|^7.0",
2525
"symfony/http-kernel": "^6.2",
26-
"twig/twig": "^2.13|^3.0.4"
26+
"twig/twig": "^2.13|~3.8.0"
2727
},
2828
"require-dev": {
2929
"symfony/asset": "^5.4|^6.0|^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": "^5.4|^6.0|^7.0",
2424
"symfony/twig-bundle": "^5.4|^6.0",
25-
"twig/twig": "^2.13|^3.0.4"
25+
"twig/twig": "^2.13|~3.8.0"
2626
},
2727
"require-dev": {
2828
"symfony/browser-kit": "^5.4|^6.0|^7.0",

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

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

504-
if (\function_exists('stream_isatty')) {
505-
return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r'));
506-
}
507-
508-
if (\function_exists('posix_isatty')) {
509-
return self::$stdinIsInteractive = @posix_isatty(fopen('php://stdin', 'r'));
510-
}
511-
512-
if (!\function_exists('shell_exec')) {
513-
return self::$stdinIsInteractive = true;
514-
}
515-
516-
return self::$stdinIsInteractive = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null'));
504+
return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r'));
517505
}
518506

519507
/**

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

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,7 @@ protected function hasColorSupport(): bool
101101
return false;
102102
}
103103

104-
if (\DIRECTORY_SEPARATOR === '\\'
105-
&& \function_exists('sapi_windows_vt100_support')
106-
&& @sapi_windows_vt100_support($this->stream)
107-
) {
104+
if ('\\' === \DIRECTORY_SEPARATOR && @sapi_windows_vt100_support($this->stream)) {
108105
return true;
109106
}
110107

@@ -116,14 +113,12 @@ protected function hasColorSupport(): bool
116113
return true;
117114
}
118115

119-
$term = (string) getenv('TERM');
120-
121-
if ('dumb' === $term) {
116+
if ('dumb' === $term = (string) getenv('TERM')) {
122117
return false;
123118
}
124119

125120
// See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157
126-
return 1 === @preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term);
121+
return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term);
127122
}
128123

129124
/**
@@ -140,19 +135,6 @@ private function isTty(): bool
140135
return true;
141136
}
142137

143-
// Modern cross-platform function, includes the fstat fallback so if it is present we trust it
144-
if (\function_exists('stream_isatty')) {
145-
return stream_isatty($this->stream);
146-
}
147-
148-
// Only trusting this if it is positive, otherwise prefer fstat fallback.
149-
if (\function_exists('posix_isatty') && posix_isatty($this->stream)) {
150-
return true;
151-
}
152-
153-
$stat = @fstat($this->stream);
154-
155-
// Check if formatted mode is S_IFCHR
156-
return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
138+
return @stream_isatty($this->stream);
157139
}
158140
}

src/Symfony/Component/Form/Resources/translations/validators.sq.xlf

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
33
<file source-language="en" target-language="sq" datatype="plaintext" original="file.ext">
4+
<header>
5+
<note>
6+
Për fjalët e huaja, të cilat nuk kanë përkthim të drejtpërdrejtë, ju lutemi të ndiqni rregullat e mëposhtme:
7+
a) në rast se emri është akronim i përdorur gjerësisht si i përveçëm, atëherë, emri lakohet pa thonjëza dhe mbaresa shkruhet me vizë ndarëse. Gjinia gjykohet sipas rastit. Shembull: JSON-i (mashkullore)
8+
b) në rast se emri është akronim i papërdorur gjerësisht si i përveçëm, atëherë, emri lakohet pa thonjëza dhe mbaresa shkruhet me vizë ndarëse. Gjinia është femërore. Shembull: URL-ja (femërore)
9+
c) në rast se emri duhet lakuar për shkak të rasës në fjali, atëherë, emri lakohet pa thonjëza dhe mbaresa shkruhet me vizë ndarëse. Shembull: host-i, prej host-it
10+
d) në rast se emri nuk duhet lakuar për shkak të trajtës në fjali, atëherë, emri rrethohet me thonjëzat “”. Shembull: “locale”
11+
</note>
12+
</header>
413
<body>
514
<trans-unit id="28">
615
<source>This form should not contain extra fields.</source>
7-
<target>Kjo formë nuk duhet të përmbajë fusha shtesë.</target>
16+
<target>Ky formular nuk duhet të përmbajë fusha shtesë.</target>
817
</trans-unit>
918
<trans-unit id="29">
1019
<source>The uploaded file was too large. Please try to upload a smaller file.</source>
11-
<target>Skedari i ngarkuar ishte shumë i madh. Ju lutemi provoni të ngarkoni një skedar më të vogël.</target>
20+
<target>Skeda e ngarkuar ishte shumë e madhe. Ju lutemi provoni të ngarkoni një skedë më të vogël.</target>
1221
</trans-unit>
1322
<trans-unit id="30">
1423
<source>The CSRF token is invalid. Please try to resubmit the form.</source>
15-
<target>Vlera CSRF është e pavlefshme. Ju lutemi provoni të ridërgoni formën.</target>
24+
<target>Vlera CSRF është e pavlefshme. Ju lutemi provoni të ridërgoni formularin.</target>
1625
</trans-unit>
1726
<trans-unit id="99">
1827
<source>This value is not a valid HTML5 color.</source>
@@ -24,7 +33,7 @@
2433
</trans-unit>
2534
<trans-unit id="101">
2635
<source>The selected choice is invalid.</source>
27-
<target>Opsioni i zgjedhur është i pavlefshëm.</target>
36+
<target>Alternativa e zgjedhur është e pavlefshme.</target>
2837
</trans-unit>
2938
<trans-unit id="102">
3039
<source>The collection is invalid.</source>
@@ -40,11 +49,11 @@
4049
</trans-unit>
4150
<trans-unit id="105">
4251
<source>Please select a valid currency.</source>
43-
<target>Ju lutemi zgjidhni një monedhë të vlefshme.</target>
52+
<target>Ju lutemi zgjidhni një valutë të vlefshme.</target>
4453
</trans-unit>
4554
<trans-unit id="106">
4655
<source>Please choose a valid date interval.</source>
47-
<target>Ju lutemi zgjidhni një interval të vlefshëm të datës.</target>
56+
<target>Ju lutemi zgjidhni një interval të vlefshëm.</target>
4857
</trans-unit>
4958
<trans-unit id="107">
5059
<source>Please enter a valid date and time.</source>
@@ -56,7 +65,7 @@
5665
</trans-unit>
5766
<trans-unit id="109">
5867
<source>Please select a valid file.</source>
59-
<target>Ju lutemi zgjidhni një skedarvlefshëm.</target>
68+
<target>Ju lutemi zgjidhni një skedëvlefshme.</target>
6069
</trans-unit>
6170
<trans-unit id="110">
6271
<source>The hidden field is invalid.</source>
@@ -68,11 +77,11 @@
6877
</trans-unit>
6978
<trans-unit id="112">
7079
<source>Please select a valid language.</source>
71-
<target state="needs-review-translation">Ju lutem zgjidhni një gjuhë të vlefshme.</target>
80+
<target>Ju lutemi zgjidhni një gjuhë të vlefshme.</target>
7281
</trans-unit>
7382
<trans-unit id="113">
7483
<source>Please select a valid locale.</source>
75-
<target>Ju lutemi zgjidhni një lokale të vlefshme.</target>
84+
<target>Ju lutemi zgjidhni një “locale” të vlefshme.</target>
7685
</trans-unit>
7786
<trans-unit id="114">
7887
<source>Please enter a valid money amount.</source>
@@ -96,7 +105,7 @@
96105
</trans-unit>
97106
<trans-unit id="119">
98107
<source>Please enter a valid time.</source>
99-
<target>Ju lutemi shkruani një kohë të vlefshme.</target>
108+
<target>Ju lutemi shkruani një orë të vlefshme.</target>
100109
</trans-unit>
101110
<trans-unit id="120">
102111
<source>Please select a valid timezone.</source>
@@ -120,15 +129,15 @@
120129
</trans-unit>
121130
<trans-unit id="125">
122131
<source>Please enter a valid email address.</source>
123-
<target>Ju lutemi shkruani një adresë të vlefshme emaili.</target>
132+
<target>Ju lutemi shkruani një adresë të vlefshme email-i.</target>
124133
</trans-unit>
125134
<trans-unit id="126">
126135
<source>Please select a valid option.</source>
127-
<target>Ju lutemi zgjidhni një opsionvlefshëm.</target>
136+
<target>Ju lutemi zgjidhni një alternativëvlefshme.</target>
128137
</trans-unit>
129138
<trans-unit id="127">
130139
<source>Please select a valid range.</source>
131-
<target>Ju lutemi zgjidhni një diapazonvlefshëm.</target>
140+
<target>Ju lutemi zgjidhni një serivlefshme.</target>
132141
</trans-unit>
133142
<trans-unit id="128">
134143
<source>Please enter a valid week.</source>

src/Symfony/Component/HttpKernel/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"symfony/validator": "^6.4|^7.0",
4747
"symfony/var-exporter": "^6.2|^7.0",
4848
"psr/cache": "^1.0|^2.0|^3.0",
49-
"twig/twig": "^2.13|^3.0.4"
49+
"twig/twig": "^2.13|~3.8.0"
5050
},
5151
"provide": {
5252
"psr/log-implementation": "1.0|2.0|3.0"

src/Symfony/Component/Messenger/Bridge/Beanstalkd/Transport/Connection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ public function reject(string $id): void
182182
public function getMessageCount(): int
183183
{
184184
try {
185+
$this->client->useTube($this->tube);
185186
$tubeStats = $this->client->statsTube($this->tube);
186187
} catch (Exception $exception) {
187188
throw new TransportException($exception->getMessage(), 0, $exception);

src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/RedisExtIntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ public function testGetAfterReject()
372372
$failing = $connection->get();
373373
$connection->reject($failing['id']);
374374

375-
$connection = Connection::fromDsn('redis://localhost/messenger-rejectthenget', ['sentinel_master' => null]);
375+
$connection = Connection::fromDsn('redis://localhost/messenger-rejectthenget', ['sentinel_master' => null], $redis);
376376
$this->assertNotNull($connection->get());
377377
} finally {
378378
$redis->unlink('messenger-rejectthenget');

src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
</trans-unit>
193193
<trans-unit id="51" resname="No temporary folder was configured in php.ini.">
194194
<source>No temporary folder was configured in php.ini, or the configured folder does not exist.</source>
195-
<target state="needs-review-translation">Privremena mapa nije konfigurirana u php.ini, ili konfigurirana mapa ne postoji.</target>
195+
<target>Privremena mapa nije konfigurirana u php.ini-u, ili konfigurirana mapa ne postoji.</target>
196196
</trans-unit>
197197
<trans-unit id="52">
198198
<source>Cannot write temporary file to disk.</source>

0 commit comments

Comments
 (0)
0