Skip to content

Commit 4ba165a

Browse files
committed
Merge branch '5.4' into 6.3
* 5.4: [String] Update wcswidth data with Unicode 15.1 [FrameworkBundle] no serializer mapping cache in debug mode without enable_annotations [Cache] fix using multiple Redis Sentinel hosts when the first one is not resolvable
2 parents 024ba81 + 7c4f174 commit 4ba165a

File tree

6 files changed

+33
-12
lines changed

6 files changed

+33
-12
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,6 +1867,10 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
18671867
$container->removeDefinition('serializer.normalizer.mime_message');
18681868
}
18691869

1870+
if ($container->getParameter('kernel.debug')) {
1871+
$container->removeDefinition('serializer.mapping.cache_class_metadata_factory');
1872+
}
1873+
18701874
// compat with Symfony < 6.3
18711875
if (!is_subclass_of(ProblemNormalizer::class, SerializerAwareInterface::class)) {
18721876
$container->getDefinition('serializer.normalizer.problem')
@@ -1875,10 +1879,6 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
18751879

18761880
$serializerLoaders = [];
18771881
if (isset($config['enable_annotations']) && $config['enable_annotations']) {
1878-
if ($container->getParameter('kernel.debug')) {
1879-
$container->removeDefinition('serializer.mapping.cache_class_metadata_factory');
1880-
}
1881-
18821882
$annotationLoader = new Definition(
18831883
AnnotationLoader::class,
18841884
[new Reference('annotation_reader', ContainerInterface::NULL_ON_INVALID_REFERENCE)]

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,6 +1572,12 @@ public function testSerializerCacheActivated()
15721572
public function testSerializerCacheUsedWithoutAnnotationsAndMappingFiles()
15731573
{
15741574
$container = $this->createContainerFromFile('serializer_mapping_without_annotations', ['kernel.debug' => true, 'kernel.container_class' => __CLASS__]);
1575+
$this->assertFalse($container->hasDefinition('serializer.mapping.cache_class_metadata_factory'));
1576+
}
1577+
1578+
public function testSerializerCacheUsedWithoutAnnotationsAndMappingFilesNoDebug()
1579+
{
1580+
$container = $this->createContainerFromFile('serializer_mapping_without_annotations', ['kernel.debug' => false, 'kernel.container_class' => __CLASS__]);
15751581
$this->assertTrue($container->hasDefinition('serializer.mapping.cache_class_metadata_factory'));
15761582
}
15771583

src/Symfony/Component/Cache/Traits/RedisTrait.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,11 @@ public static function createConnection(#[\SensitiveParameter] string $dsn, arra
227227
}
228228
$sentinel = new $sentinelClass($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout'], ...$extra);
229229

230-
if ($address = $sentinel->getMasterAddrByName($params['redis_sentinel'])) {
231-
[$host, $port] = $address;
230+
try {
231+
if ($address = $sentinel->getMasterAddrByName($params['redis_sentinel'])) {
232+
[$host, $port] = $address;
233+
}
234+
} catch (\RedisException $e) {
232235
}
233236
} while (++$hostIndex < \count($hosts) && !$address);
234237

src/Symfony/Component/String/Resources/WcswidthDataGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ private function writeWideWidthData(): void
4646

4747
$version = $matches[1];
4848

49-
if (!preg_match_all('/^([A-H\d]{4,})(?:\.\.([A-H\d]{4,}))?;[W|F]/m', $content, $matches, \PREG_SET_ORDER)) {
49+
if (!preg_match_all('/^([A-H\d]{4,})(?:\.\.([A-H\d]{4,}))? +; [W|F]/m', $content, $matches, \PREG_SET_ORDER)) {
5050
throw new RuntimeException('The wide width pattern did not match anything.');
5151
}
5252

src/Symfony/Component/String/Resources/data/wcswidth_table_wide.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
/*
44
* This file has been auto-generated by the Symfony String Component for internal use.
55
*
6-
* Unicode version: 15.0.0
7-
* Date: 2022-10-05T17:16:36+02:00
6+
* Unicode version: 15.1.0
7+
* Date: 2023-09-13T11:47:12+00:00
88
*/
99

1010
return [
@@ -166,7 +166,7 @@
166166
],
167167
[
168168
12272,
169-
12283,
169+
12287,
170170
],
171171
[
172172
12288,
@@ -396,6 +396,10 @@
396396
12736,
397397
12771,
398398
],
399+
[
400+
12783,
401+
12783,
402+
],
399403
[
400404
12784,
401405
12799,
@@ -1110,6 +1114,14 @@
11101114
],
11111115
[
11121116
191457,
1117+
191471,
1118+
],
1119+
[
1120+
191472,
1121+
192093,
1122+
],
1123+
[
1124+
192094,
11131125
194559,
11141126
],
11151127
[

src/Symfony/Component/String/Resources/data/wcswidth_table_zero.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
/*
44
* This file has been auto-generated by the Symfony String Component for internal use.
55
*
6-
* Unicode version: 15.0.0
7-
* Date: 2022-10-05T17:16:37+02:00
6+
* Unicode version: 15.1.0
7+
* Date: 2023-09-13T11:47:13+00:00
88
*/
99

1010
return [

0 commit comments

Comments
 (0)