From dc2ab4faf18be12eb0795e1f9fceafff9df6b44d Mon Sep 17 00:00:00 2001 From: HypeMC Date: Thu, 7 Sep 2023 00:39:36 +0200 Subject: [PATCH 1/6] [FrameworkBundle] Always use buildDir as `ConfigBuilderGenerator` outputDir --- CacheWarmer/ConfigBuilderCacheWarmer.php | 2 +- .../ConfigBuilderCacheWarmerTest.php | 78 +++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php diff --git a/CacheWarmer/ConfigBuilderCacheWarmer.php b/CacheWarmer/ConfigBuilderCacheWarmer.php index ed20bbcb6..50843f526 100644 --- a/CacheWarmer/ConfigBuilderCacheWarmer.php +++ b/CacheWarmer/ConfigBuilderCacheWarmer.php @@ -44,7 +44,7 @@ public function __construct(KernelInterface $kernel, LoggerInterface $logger = n */ public function warmUp(string $cacheDir) { - $generator = new ConfigBuilderGenerator($cacheDir); + $generator = new ConfigBuilderGenerator($this->kernel->getBuildDir()); foreach ($this->kernel->getBundles() as $bundle) { $extension = $bundle->getContainerExtension(); diff --git a/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php b/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php new file mode 100644 index 000000000..c64e5d3b4 --- /dev/null +++ b/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\FrameworkBundle\Tests\CacheWarmer; + +use Symfony\Bundle\FrameworkBundle\CacheWarmer\ConfigBuilderCacheWarmer; +use Symfony\Bundle\FrameworkBundle\FrameworkBundle; +use Symfony\Bundle\FrameworkBundle\Tests\TestCase; +use Symfony\Component\Config\Loader\LoaderInterface; +use Symfony\Component\Filesystem\Filesystem; +use Symfony\Component\HttpKernel\Kernel; + +class ConfigBuilderCacheWarmerTest extends TestCase +{ + private $varDir; + + protected function setUp(): void + { + $this->varDir = sys_get_temp_dir().'/'.uniqid(); + $fs = new Filesystem(); + $fs->mkdir($this->varDir); + } + + protected function tearDown(): void + { + $fs = new Filesystem(); + $fs->remove($this->varDir); + unset($this->varDir); + } + + public function testBuildDirIsUsedAsConfigBuilderOutputDir() + { + $kernel = new class($this->varDir) extends Kernel { + private $varDir; + + public function __construct(string $varDir) + { + parent::__construct('test', false); + + $this->varDir = $varDir; + } + + public function registerBundles(): iterable + { + yield new FrameworkBundle(); + } + + public function getBuildDir(): string + { + return $this->varDir.'/build'; + } + + public function getCacheDir(): string + { + return $this->varDir.'/cache'; + } + + public function registerContainerConfiguration(LoaderInterface $loader) + { + } + }; + $kernel->boot(); + + $warmer = new ConfigBuilderCacheWarmer($kernel); + $warmer->warmUp($kernel->getCacheDir()); + + self::assertDirectoryExists($kernel->getBuildDir().'/Symfony'); + self::assertDirectoryDoesNotExist($kernel->getCacheDir().'/Symfony'); + } +} From 96b37be309368e52fe6d329085cf6bb4ee1619f6 Mon Sep 17 00:00:00 2001 From: soyuka Date: Sun, 27 Aug 2023 12:21:37 +0200 Subject: [PATCH 2/6] [FrameworkBundle] no serializer mapping cache in debug mode without enable_annotations There's no reason we should disable the cache only without `enable_annotations`, when working only with attributes, in debug mode the cache is enabled which is why we often need to clear cache when changing a serialized object to get the changes. --- DependencyInjection/FrameworkExtension.php | 7 ++++--- Tests/DependencyInjection/FrameworkExtensionTestCase.php | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/DependencyInjection/FrameworkExtension.php b/DependencyInjection/FrameworkExtension.php index 206bda103..da60eeabb 100644 --- a/DependencyInjection/FrameworkExtension.php +++ b/DependencyInjection/FrameworkExtension.php @@ -1790,14 +1790,15 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder $container->removeDefinition('serializer.normalizer.mime_message'); } + if ($container->getParameter('kernel.debug')) { + $container->removeDefinition('serializer.mapping.cache_class_metadata_factory'); + } + $serializerLoaders = []; if (isset($config['enable_annotations']) && $config['enable_annotations']) { if (\PHP_VERSION_ID < 80000 && !$this->annotationsConfigEnabled) { throw new \LogicException('"enable_annotations" on the serializer cannot be set as the PHP version is lower than 8 and Annotations support is disabled. Consider upgrading PHP.'); } - if ($container->getParameter('kernel.debug')) { - $container->removeDefinition('serializer.mapping.cache_class_metadata_factory'); - } $annotationLoader = new Definition( 'Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader', diff --git a/Tests/DependencyInjection/FrameworkExtensionTestCase.php b/Tests/DependencyInjection/FrameworkExtensionTestCase.php index d1a0f52ea..f5429d617 100644 --- a/Tests/DependencyInjection/FrameworkExtensionTestCase.php +++ b/Tests/DependencyInjection/FrameworkExtensionTestCase.php @@ -1530,6 +1530,12 @@ public function testSerializerCacheActivated() public function testSerializerCacheUsedWithoutAnnotationsAndMappingFiles() { $container = $this->createContainerFromFile('serializer_mapping_without_annotations', ['kernel.debug' => true, 'kernel.container_class' => __CLASS__]); + $this->assertFalse($container->hasDefinition('serializer.mapping.cache_class_metadata_factory')); + } + + public function testSerializerCacheUsedWithoutAnnotationsAndMappingFilesNoDebug() + { + $container = $this->createContainerFromFile('serializer_mapping_without_annotations', ['kernel.debug' => false, 'kernel.container_class' => __CLASS__]); $this->assertTrue($container->hasDefinition('serializer.mapping.cache_class_metadata_factory')); } From d864ddbcd3d463ae19dbff094310324ed5e855e0 Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Fri, 15 Sep 2023 15:46:46 +0200 Subject: [PATCH 3/6] [FrameworkBundle] Handle tags array attributes in descriptors --- Console/Descriptor/MarkdownDescriptor.php | 2 +- Console/Descriptor/TextDescriptor.php | 12 ++++- Tests/Console/Descriptor/ObjectsProvider.php | 1 + .../Descriptor/alias_with_definition_2.json | 18 ++++++++ .../Descriptor/alias_with_definition_2.md | 2 + .../Descriptor/alias_with_definition_2.txt | 44 ++++++++++--------- .../Descriptor/alias_with_definition_2.xml | 3 ++ .../Descriptor/builder_1_services.json | 18 ++++++++ .../Fixtures/Descriptor/builder_1_services.md | 2 + .../Descriptor/builder_1_services.xml | 3 ++ Tests/Fixtures/Descriptor/builder_1_tag1.json | 18 ++++++++ Tests/Fixtures/Descriptor/builder_1_tag1.md | 2 + Tests/Fixtures/Descriptor/builder_1_tag1.xml | 3 ++ Tests/Fixtures/Descriptor/builder_1_tags.json | 20 +++++++++ Tests/Fixtures/Descriptor/builder_1_tags.md | 21 +++++++++ Tests/Fixtures/Descriptor/builder_1_tags.txt | 5 +++ Tests/Fixtures/Descriptor/builder_1_tags.xml | 8 ++++ Tests/Fixtures/Descriptor/definition_2.json | 18 ++++++++ Tests/Fixtures/Descriptor/definition_2.md | 2 + Tests/Fixtures/Descriptor/definition_2.txt | 43 +++++++++--------- Tests/Fixtures/Descriptor/definition_2.xml | 3 ++ .../Descriptor/definition_arguments_2.json | 18 ++++++++ .../Descriptor/definition_arguments_2.md | 2 + .../Descriptor/definition_arguments_2.txt | 43 +++++++++--------- .../Descriptor/definition_arguments_2.xml | 3 ++ 25 files changed, 248 insertions(+), 66 deletions(-) diff --git a/Console/Descriptor/MarkdownDescriptor.php b/Console/Descriptor/MarkdownDescriptor.php index 7423a2855..42574a80a 100644 --- a/Console/Descriptor/MarkdownDescriptor.php +++ b/Console/Descriptor/MarkdownDescriptor.php @@ -254,7 +254,7 @@ protected function describeContainerDefinition(Definition $definition, array $op foreach ($tagData as $parameters) { $output .= "\n".'- Tag: `'.$tagName.'`'; foreach ($parameters as $name => $value) { - $output .= "\n".' - '.ucfirst($name).': '.$value; + $output .= "\n".' - '.ucfirst($name).': '.(\is_array($value) ? $this->formatParameter($value) : $value); } } } diff --git a/Console/Descriptor/TextDescriptor.php b/Console/Descriptor/TextDescriptor.php index 06afc5cea..444f3b512 100644 --- a/Console/Descriptor/TextDescriptor.php +++ b/Console/Descriptor/TextDescriptor.php @@ -209,6 +209,10 @@ protected function describeContainerServices(ContainerBuilder $container, array if (!isset($maxTags[$key])) { $maxTags[$key] = \strlen($key); } + if (\is_array($value)) { + $value = $this->formatParameter($value); + } + if (\strlen($value) > $maxTags[$key]) { $maxTags[$key] = \strlen($value); } @@ -233,7 +237,11 @@ protected function describeContainerServices(ContainerBuilder $container, array foreach ($this->sortByPriority($definition->getTag($showTag)) as $key => $tag) { $tagValues = []; foreach ($tagsNames as $tagName) { - $tagValues[] = $tag[$tagName] ?? ''; + if (\is_array($tagValue = $tag[$tagName] ?? '')) { + $tagValue = $this->formatParameter($tagValue); + } + + $tagValues[] = $tagValue; } if (0 === $key) { $tableRows[] = array_merge([$serviceId], $tagValues, [$definition->getClass()]); @@ -275,7 +283,7 @@ protected function describeContainerDefinition(Definition $definition, array $op $tagInformation = []; foreach ($tags as $tagName => $tagData) { foreach ($tagData as $tagParameters) { - $parameters = array_map(fn ($key, $value) => sprintf('%s: %s', $key, $value), array_keys($tagParameters), array_values($tagParameters)); + $parameters = array_map(fn ($key, $value) => sprintf('%s: %s', $key, \is_array($value) ? $this->formatParameter($value) : $value), array_keys($tagParameters), array_values($tagParameters)); $parameters = implode(', ', $parameters); if ('' === $parameters) { diff --git a/Tests/Console/Descriptor/ObjectsProvider.php b/Tests/Console/Descriptor/ObjectsProvider.php index daafc6011..cc9cfad68 100644 --- a/Tests/Console/Descriptor/ObjectsProvider.php +++ b/Tests/Console/Descriptor/ObjectsProvider.php @@ -169,6 +169,7 @@ public static function getContainerDefinitions() ->addTag('tag1', ['attr1' => 'val1', 'attr2' => 'val2']) ->addTag('tag1', ['attr3' => 'val3']) ->addTag('tag2') + ->addTag('tag3', ['array_attr' => ['foo', 'bar', [[[['ccc']]]]]]) ->addMethodCall('setMailer', [new Reference('mailer')]) ->setFactory([new Reference('factory.service'), 'get']), '.definition_3' => $definition3 diff --git a/Tests/Fixtures/Descriptor/alias_with_definition_2.json b/Tests/Fixtures/Descriptor/alias_with_definition_2.json index 419ee6786..f3b930983 100644 --- a/Tests/Fixtures/Descriptor/alias_with_definition_2.json +++ b/Tests/Fixtures/Descriptor/alias_with_definition_2.json @@ -36,6 +36,24 @@ { "name": "tag2", "parameters": [] + }, + { + "name": "tag3", + "parameters": { + "array_attr": [ + "foo", + "bar", + [ + [ + [ + [ + "ccc" + ] + ] + ] + ] + ] + } } ], "usages": [ diff --git a/Tests/Fixtures/Descriptor/alias_with_definition_2.md b/Tests/Fixtures/Descriptor/alias_with_definition_2.md index d25978492..3ec9516a3 100644 --- a/Tests/Fixtures/Descriptor/alias_with_definition_2.md +++ b/Tests/Fixtures/Descriptor/alias_with_definition_2.md @@ -24,4 +24,6 @@ - Tag: `tag1` - Attr3: val3 - Tag: `tag2` +- Tag: `tag3` + - Array_attr: ["foo","bar",[[[["ccc"]]]]] - Usages: .alias_2 diff --git a/Tests/Fixtures/Descriptor/alias_with_definition_2.txt b/Tests/Fixtures/Descriptor/alias_with_definition_2.txt index 6ab25c269..46699413a 100644 --- a/Tests/Fixtures/Descriptor/alias_with_definition_2.txt +++ b/Tests/Fixtures/Descriptor/alias_with_definition_2.txt @@ -3,24 +3,26 @@ Information for Service ".service_2" ==================================== - ----------------- --------------------------------- -  Option   Value  - ----------------- --------------------------------- - Service ID .service_2 - Class Full\Qualified\Class2 - Tags tag1 (attr1: val1, attr2: val2) - tag1 (attr3: val3) - tag2 - Calls setMailer - Public no - Synthetic yes - Lazy no - Shared yes - Abstract no - Autowired no - Autoconfigured no - Required File /path/to/file - Factory Service factory.service - Factory Method get - Usages .alias_2 - ----------------- --------------------------------- + ----------------- ------------------------------------------------ +  Option   Value  + ----------------- ------------------------------------------------ + Service ID .service_2 + Class Full\Qualified\Class2 + Tags tag1 (attr1: val1, attr2: val2) + tag1 (attr3: val3) + tag2 + tag3 (array_attr: ["foo","bar",[[[["ccc"]]]]]) + Calls setMailer + Public no + Synthetic yes + Lazy no + Shared yes + Abstract no + Autowired no + Autoconfigured no + Required File /path/to/file + Factory Service factory.service + Factory Method get + Usages .alias_2 + ----------------- ------------------------------------------------ + diff --git a/Tests/Fixtures/Descriptor/alias_with_definition_2.xml b/Tests/Fixtures/Descriptor/alias_with_definition_2.xml index f9d5c70c8..aee83ef82 100644 --- a/Tests/Fixtures/Descriptor/alias_with_definition_2.xml +++ b/Tests/Fixtures/Descriptor/alias_with_definition_2.xml @@ -14,6 +14,9 @@ val3 + + ["foo","bar",[[[["ccc"]]]]] + .alias_2 diff --git a/Tests/Fixtures/Descriptor/builder_1_services.json b/Tests/Fixtures/Descriptor/builder_1_services.json index 9bb716e44..ac6d122ce 100644 --- a/Tests/Fixtures/Descriptor/builder_1_services.json +++ b/Tests/Fixtures/Descriptor/builder_1_services.json @@ -33,6 +33,24 @@ { "name": "tag2", "parameters": [] + }, + { + "name": "tag3", + "parameters": { + "array_attr": [ + "foo", + "bar", + [ + [ + [ + [ + "ccc" + ] + ] + ] + ] + ] + } } ], "usages": [] diff --git a/Tests/Fixtures/Descriptor/builder_1_services.md b/Tests/Fixtures/Descriptor/builder_1_services.md index 3825ed8eb..6dfab327d 100644 --- a/Tests/Fixtures/Descriptor/builder_1_services.md +++ b/Tests/Fixtures/Descriptor/builder_1_services.md @@ -25,6 +25,8 @@ Definitions - Tag: `tag1` - Attr3: val3 - Tag: `tag2` +- Tag: `tag3` + - Array_attr: ["foo","bar",[[[["ccc"]]]]] - Usages: none ### .definition_3 diff --git a/Tests/Fixtures/Descriptor/builder_1_services.xml b/Tests/Fixtures/Descriptor/builder_1_services.xml index d3cf16a0f..84499f084 100644 --- a/Tests/Fixtures/Descriptor/builder_1_services.xml +++ b/Tests/Fixtures/Descriptor/builder_1_services.xml @@ -15,6 +15,9 @@ val3 + + ["foo","bar",[[[["ccc"]]]]] + diff --git a/Tests/Fixtures/Descriptor/builder_1_tag1.json b/Tests/Fixtures/Descriptor/builder_1_tag1.json index 66eb0af83..5e60f26d1 100644 --- a/Tests/Fixtures/Descriptor/builder_1_tag1.json +++ b/Tests/Fixtures/Descriptor/builder_1_tag1.json @@ -33,6 +33,24 @@ { "name": "tag2", "parameters": [] + }, + { + "name": "tag3", + "parameters": { + "array_attr": [ + "foo", + "bar", + [ + [ + [ + [ + "ccc" + ] + ] + ] + ] + ] + } } ], "usages": [] diff --git a/Tests/Fixtures/Descriptor/builder_1_tag1.md b/Tests/Fixtures/Descriptor/builder_1_tag1.md index a76b77df0..aeae0d9f2 100644 --- a/Tests/Fixtures/Descriptor/builder_1_tag1.md +++ b/Tests/Fixtures/Descriptor/builder_1_tag1.md @@ -25,4 +25,6 @@ Definitions - Tag: `tag1` - Attr3: val3 - Tag: `tag2` +- Tag: `tag3` + - Array_attr: ["foo","bar",[[[["ccc"]]]]] - Usages: none diff --git a/Tests/Fixtures/Descriptor/builder_1_tag1.xml b/Tests/Fixtures/Descriptor/builder_1_tag1.xml index b2929b01a..5413d7e5e 100644 --- a/Tests/Fixtures/Descriptor/builder_1_tag1.xml +++ b/Tests/Fixtures/Descriptor/builder_1_tag1.xml @@ -14,6 +14,9 @@ val3 + + ["foo","bar",[[[["ccc"]]]]] + diff --git a/Tests/Fixtures/Descriptor/builder_1_tags.json b/Tests/Fixtures/Descriptor/builder_1_tags.json index e0679f2ca..518f694ea 100644 --- a/Tests/Fixtures/Descriptor/builder_1_tags.json +++ b/Tests/Fixtures/Descriptor/builder_1_tags.json @@ -38,5 +38,25 @@ ], "usages": [] } + ], + "tag3": [ + { + "class": "Full\\Qualified\\Class2", + "public": false, + "synthetic": true, + "lazy": false, + "shared": true, + "abstract": false, + "autowire": false, + "autoconfigure": false, + "deprecated": false, + "file": "\/path\/to\/file", + "factory_service": "factory.service", + "factory_method": "get", + "calls": [ + "setMailer" + ], + "usages": [] + } ] } diff --git a/Tests/Fixtures/Descriptor/builder_1_tags.md b/Tests/Fixtures/Descriptor/builder_1_tags.md index f9558d326..80da2ddaf 100644 --- a/Tests/Fixtures/Descriptor/builder_1_tags.md +++ b/Tests/Fixtures/Descriptor/builder_1_tags.md @@ -41,3 +41,24 @@ tag2 - Factory Method: `get` - Call: `setMailer` - Usages: none + + +tag3 +---- + +### .definition_2 + +- Class: `Full\Qualified\Class2` +- Public: no +- Synthetic: yes +- Lazy: no +- Shared: yes +- Abstract: no +- Autowired: no +- Autoconfigured: no +- Deprecated: no +- File: `/path/to/file` +- Factory Service: `factory.service` +- Factory Method: `get` +- Call: `setMailer` +- Usages: none diff --git a/Tests/Fixtures/Descriptor/builder_1_tags.txt b/Tests/Fixtures/Descriptor/builder_1_tags.txt index b10e4661f..5be3bb079 100644 --- a/Tests/Fixtures/Descriptor/builder_1_tags.txt +++ b/Tests/Fixtures/Descriptor/builder_1_tags.txt @@ -12,3 +12,8 @@ * .definition_2 +"tag3" tag +---------- + + * .definition_2 + diff --git a/Tests/Fixtures/Descriptor/builder_1_tags.xml b/Tests/Fixtures/Descriptor/builder_1_tags.xml index 75a9714f5..1c68779f0 100644 --- a/Tests/Fixtures/Descriptor/builder_1_tags.xml +++ b/Tests/Fixtures/Descriptor/builder_1_tags.xml @@ -16,4 +16,12 @@ + + + + + + + + diff --git a/Tests/Fixtures/Descriptor/definition_2.json b/Tests/Fixtures/Descriptor/definition_2.json index 622904da2..a661428c9 100644 --- a/Tests/Fixtures/Descriptor/definition_2.json +++ b/Tests/Fixtures/Descriptor/definition_2.json @@ -31,6 +31,24 @@ { "name": "tag2", "parameters": [] + }, + { + "name": "tag3", + "parameters": { + "array_attr": [ + "foo", + "bar", + [ + [ + [ + [ + "ccc" + ] + ] + ] + ] + ] + } } ], "usages": [] diff --git a/Tests/Fixtures/Descriptor/definition_2.md b/Tests/Fixtures/Descriptor/definition_2.md index 376cbdb52..486f35fb7 100644 --- a/Tests/Fixtures/Descriptor/definition_2.md +++ b/Tests/Fixtures/Descriptor/definition_2.md @@ -17,4 +17,6 @@ - Tag: `tag1` - Attr3: val3 - Tag: `tag2` +- Tag: `tag3` + - Array_attr: ["foo","bar",[[[["ccc"]]]]] - Usages: none diff --git a/Tests/Fixtures/Descriptor/definition_2.txt b/Tests/Fixtures/Descriptor/definition_2.txt index 2b8d3dde5..6fdb6d980 100644 --- a/Tests/Fixtures/Descriptor/definition_2.txt +++ b/Tests/Fixtures/Descriptor/definition_2.txt @@ -1,22 +1,23 @@ - ----------------- --------------------------------- -  Option   Value  - ----------------- --------------------------------- - Service ID - - Class Full\Qualified\Class2 - Tags tag1 (attr1: val1, attr2: val2) - tag1 (attr3: val3) - tag2 - Calls setMailer - Public no - Synthetic yes - Lazy no - Shared yes - Abstract no - Autowired no - Autoconfigured no - Required File /path/to/file - Factory Service factory.service - Factory Method get - Usages none - ----------------- --------------------------------- + ----------------- ------------------------------------------------ +  Option   Value  + ----------------- ------------------------------------------------ + Service ID - + Class Full\Qualified\Class2 + Tags tag1 (attr1: val1, attr2: val2) + tag1 (attr3: val3) + tag2 + tag3 (array_attr: ["foo","bar",[[[["ccc"]]]]]) + Calls setMailer + Public no + Synthetic yes + Lazy no + Shared yes + Abstract no + Autowired no + Autoconfigured no + Required File /path/to/file + Factory Service factory.service + Factory Method get + Usages none + ----------------- ------------------------------------------------ diff --git a/Tests/Fixtures/Descriptor/definition_2.xml b/Tests/Fixtures/Descriptor/definition_2.xml index ab072f3e3..4dd3ca0a0 100644 --- a/Tests/Fixtures/Descriptor/definition_2.xml +++ b/Tests/Fixtures/Descriptor/definition_2.xml @@ -13,5 +13,8 @@ val3 + + ["foo","bar",[[[["ccc"]]]]] + diff --git a/Tests/Fixtures/Descriptor/definition_arguments_2.json b/Tests/Fixtures/Descriptor/definition_arguments_2.json index 20ef01a34..eeeb6f44a 100644 --- a/Tests/Fixtures/Descriptor/definition_arguments_2.json +++ b/Tests/Fixtures/Descriptor/definition_arguments_2.json @@ -32,6 +32,24 @@ { "name": "tag2", "parameters": [] + }, + { + "name": "tag3", + "parameters": { + "array_attr": [ + "foo", + "bar", + [ + [ + [ + [ + "ccc" + ] + ] + ] + ] + ] + } } ], "usages": [] diff --git a/Tests/Fixtures/Descriptor/definition_arguments_2.md b/Tests/Fixtures/Descriptor/definition_arguments_2.md index f5bf50e61..5b427bff5 100644 --- a/Tests/Fixtures/Descriptor/definition_arguments_2.md +++ b/Tests/Fixtures/Descriptor/definition_arguments_2.md @@ -18,4 +18,6 @@ - Tag: `tag1` - Attr3: val3 - Tag: `tag2` +- Tag: `tag3` + - Array_attr: ["foo","bar",[[[["ccc"]]]]] - Usages: none diff --git a/Tests/Fixtures/Descriptor/definition_arguments_2.txt b/Tests/Fixtures/Descriptor/definition_arguments_2.txt index 2b8d3dde5..43ca2cffa 100644 --- a/Tests/Fixtures/Descriptor/definition_arguments_2.txt +++ b/Tests/Fixtures/Descriptor/definition_arguments_2.txt @@ -1,22 +1,23 @@ - ----------------- --------------------------------- -  Option   Value  - ----------------- --------------------------------- - Service ID - - Class Full\Qualified\Class2 - Tags tag1 (attr1: val1, attr2: val2) - tag1 (attr3: val3) - tag2 - Calls setMailer - Public no - Synthetic yes - Lazy no - Shared yes - Abstract no - Autowired no - Autoconfigured no - Required File /path/to/file - Factory Service factory.service - Factory Method get - Usages none - ----------------- --------------------------------- + ----------------- ------------------------------------------------ +  Option   Value  + ----------------- ------------------------------------------------ + Service ID - + Class Full\Qualified\Class2 + Tags tag1 (attr1: val1, attr2: val2) + tag1 (attr3: val3) + tag2 + tag3 (array_attr: ["foo","bar",[[[["ccc"]]]]]) + Calls setMailer + Public no + Synthetic yes + Lazy no + Shared yes + Abstract no + Autowired no + Autoconfigured no + Required File /path/to/file + Factory Service factory.service + Factory Method get + Usages none + ----------------- ------------------------------------------------ diff --git a/Tests/Fixtures/Descriptor/definition_arguments_2.xml b/Tests/Fixtures/Descriptor/definition_arguments_2.xml index ab072f3e3..4dd3ca0a0 100644 --- a/Tests/Fixtures/Descriptor/definition_arguments_2.xml +++ b/Tests/Fixtures/Descriptor/definition_arguments_2.xml @@ -13,5 +13,8 @@ val3 + + ["foo","bar",[[[["ccc"]]]]] + From 4a903eb479edefec0e4da306b7bae17c25b6d532 Mon Sep 17 00:00:00 2001 From: Jules Pietri Date: Sat, 16 Sep 2023 13:22:53 +0200 Subject: [PATCH 4/6] [Translator] Fix support for `default_path` in XML --- Resources/config/schema/symfony-1.0.xsd | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/config/schema/symfony-1.0.xsd b/Resources/config/schema/symfony-1.0.xsd index 29f64dad9..faee50e25 100644 --- a/Resources/config/schema/symfony-1.0.xsd +++ b/Resources/config/schema/symfony-1.0.xsd @@ -191,6 +191,7 @@ + From 9cbdd32c0df74957a0ee67197b42f31bbede0100 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 27 Sep 2023 19:22:38 +0200 Subject: [PATCH 5/6] Fix merge --- Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php b/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php index c64e5d3b4..1336caed3 100644 --- a/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php +++ b/Tests/CacheWarmer/ConfigBuilderCacheWarmerTest.php @@ -15,6 +15,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Tests\TestCase; use Symfony\Component\Config\Loader\LoaderInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpKernel\Kernel; @@ -63,8 +64,11 @@ public function getCacheDir(): string return $this->varDir.'/cache'; } - public function registerContainerConfiguration(LoaderInterface $loader) + public function registerContainerConfiguration(LoaderInterface $loader): void { + $loader->load(static function (ContainerBuilder $container) { + $container->loadFromExtension('framework', ['http_method_override' => false]); + }); } }; $kernel->boot(); From 567cafcfc08e3076b47290a7558b0ca17a98b0ce Mon Sep 17 00:00:00 2001 From: HypeMC Date: Tue, 11 Jul 2023 22:10:48 +0200 Subject: [PATCH 6/6] [Messenger] Fix exiting `FailedMessagesRetryCommand` --- DependencyInjection/FrameworkExtension.php | 10 ++++++++++ Resources/config/console.php | 2 ++ 2 files changed, 12 insertions(+) diff --git a/DependencyInjection/FrameworkExtension.php b/DependencyInjection/FrameworkExtension.php index f7b80aeef..7f56245a4 100644 --- a/DependencyInjection/FrameworkExtension.php +++ b/DependencyInjection/FrameworkExtension.php @@ -2098,6 +2098,16 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder $container->getDefinition('messenger.transport.beanstalkd.factory')->addTag('messenger.transport_factory'); } + if ($config['stop_worker_on_signals'] && $this->hasConsole()) { + $container->getDefinition('console.command.messenger_consume_messages') + ->replaceArgument(8, $config['stop_worker_on_signals']); + $container->getDefinition('console.command.messenger_failed_messages_retry') + ->replaceArgument(6, $config['stop_worker_on_signals']); + } + + if ($this->hasConsole() && $container->hasDefinition('messenger.listener.stop_worker_signals_listener')) { + $container->getDefinition('messenger.listener.stop_worker_signals_listener')->clearTag('kernel.event_subscriber'); + } if ($config['stop_worker_on_signals']) { $container->getDefinition('messenger.listener.stop_worker_signals_listener')->replaceArgument(0, $config['stop_worker_on_signals']); } diff --git a/Resources/config/console.php b/Resources/config/console.php index 2be737e98..b49ed07a0 100644 --- a/Resources/config/console.php +++ b/Resources/config/console.php @@ -163,6 +163,7 @@ service('messenger.listener.reset_services')->nullOnInvalid(), [], // Bus names service('messenger.rate_limiter_locator')->nullOnInvalid(), + null, ]) ->tag('console.command') ->tag('monolog.logger', ['channel' => 'messenger']) @@ -194,6 +195,7 @@ service('event_dispatcher'), service('logger')->nullOnInvalid(), service('messenger.transport.native_php_serializer')->nullOnInvalid(), + null, ]) ->tag('console.command') ->tag('monolog.logger', ['channel' => 'messenger'])