From da94089ac137398495bc52b09780e8e9565b89aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Kukli=C5=84ski?= Date: Sun, 12 Jan 2025 15:55:32 +0100 Subject: [PATCH 1/3] Put registering resources to from load to prepend method in BitBagSyliusWishlistExtension --- .../BitBagSyliusWishlistExtension.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/DependencyInjection/BitBagSyliusWishlistExtension.php b/src/DependencyInjection/BitBagSyliusWishlistExtension.php index 3b6b26ec..83bfe530 100644 --- a/src/DependencyInjection/BitBagSyliusWishlistExtension.php +++ b/src/DependencyInjection/BitBagSyliusWishlistExtension.php @@ -26,7 +26,7 @@ public function load(array $config, ContainerBuilder $container): void { $config = $this->processConfiguration($this->getConfiguration([], $container), $config); $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); - $this->registerResources('bitbag_sylius_wishlist_plugin', 'doctrine/orm', $config['resources'], $container); + $loader->load('services.xml'); $container->setParameter('bitbag_sylius_wishlist_plugin.parameters.wishlist_cookie_token', $config['wishlist_cookie_token']); $container->setParameter('bitbag_sylius_wishlist_plugin.parameters.allowed_mime_types', $config['allowed_mime_types']); @@ -36,6 +36,9 @@ public function prepend(ContainerBuilder $container): void { trigger_deprecation('bitbag/wishlist-plugin', '2.0', 'Doctrine migrations existing in a bundle will be removed, move migrations to the project directory.'); $this->prependDoctrineMigrations($container); + + $config = $this->getCurrentConfiguration($container); + $this->registerResources('bitbag_sylius_wishlist_plugin', 'doctrine/orm', $config['resources'], $container); } protected function getMigrationsNamespace(): string @@ -52,4 +55,13 @@ protected function getNamespacesOfMigrationsExecutedBefore(): array { return ['Sylius\Bundle\CoreBundle\Migrations']; } + + private function getCurrentConfiguration(ContainerBuilder $container): array + { + /** @var ConfigurationInterface $configuration */ + $configuration = $this->getConfiguration([], $container); + $configs = $container->getExtensionConfig($this->getAlias()); + + return $this->processConfiguration($configuration, $configs); + } } From c9fb2911d6a778f7b1a207ee2bae4f227556628d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Kukli=C5=84ski?= Date: Sun, 12 Jan 2025 15:59:28 +0100 Subject: [PATCH 2/3] Revert "Put registering resources to from load to prepend method in BitBagSyliusWishlistExtension" This reverts commit da94089ac137398495bc52b09780e8e9565b89aa. --- .../BitBagSyliusWishlistExtension.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/DependencyInjection/BitBagSyliusWishlistExtension.php b/src/DependencyInjection/BitBagSyliusWishlistExtension.php index 83bfe530..3b6b26ec 100644 --- a/src/DependencyInjection/BitBagSyliusWishlistExtension.php +++ b/src/DependencyInjection/BitBagSyliusWishlistExtension.php @@ -26,7 +26,7 @@ public function load(array $config, ContainerBuilder $container): void { $config = $this->processConfiguration($this->getConfiguration([], $container), $config); $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); - + $this->registerResources('bitbag_sylius_wishlist_plugin', 'doctrine/orm', $config['resources'], $container); $loader->load('services.xml'); $container->setParameter('bitbag_sylius_wishlist_plugin.parameters.wishlist_cookie_token', $config['wishlist_cookie_token']); $container->setParameter('bitbag_sylius_wishlist_plugin.parameters.allowed_mime_types', $config['allowed_mime_types']); @@ -36,9 +36,6 @@ public function prepend(ContainerBuilder $container): void { trigger_deprecation('bitbag/wishlist-plugin', '2.0', 'Doctrine migrations existing in a bundle will be removed, move migrations to the project directory.'); $this->prependDoctrineMigrations($container); - - $config = $this->getCurrentConfiguration($container); - $this->registerResources('bitbag_sylius_wishlist_plugin', 'doctrine/orm', $config['resources'], $container); } protected function getMigrationsNamespace(): string @@ -55,13 +52,4 @@ protected function getNamespacesOfMigrationsExecutedBefore(): array { return ['Sylius\Bundle\CoreBundle\Migrations']; } - - private function getCurrentConfiguration(ContainerBuilder $container): array - { - /** @var ConfigurationInterface $configuration */ - $configuration = $this->getConfiguration([], $container); - $configs = $container->getExtensionConfig($this->getAlias()); - - return $this->processConfiguration($configuration, $configs); - } } From 4b672b5150f5d7081f3779fcd08b7c2ca6369761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Kukli=C5=84ski?= Date: Sun, 12 Jan 2025 16:03:02 +0100 Subject: [PATCH 3/3] Revert "Revert "Put registering resources to from load to prepend method in BitBagSyliusWishlistExtension"" This reverts commit c9fb2911d6a778f7b1a207ee2bae4f227556628d. --- .../BitBagSyliusWishlistExtension.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/DependencyInjection/BitBagSyliusWishlistExtension.php b/src/DependencyInjection/BitBagSyliusWishlistExtension.php index 3b6b26ec..83bfe530 100644 --- a/src/DependencyInjection/BitBagSyliusWishlistExtension.php +++ b/src/DependencyInjection/BitBagSyliusWishlistExtension.php @@ -26,7 +26,7 @@ public function load(array $config, ContainerBuilder $container): void { $config = $this->processConfiguration($this->getConfiguration([], $container), $config); $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); - $this->registerResources('bitbag_sylius_wishlist_plugin', 'doctrine/orm', $config['resources'], $container); + $loader->load('services.xml'); $container->setParameter('bitbag_sylius_wishlist_plugin.parameters.wishlist_cookie_token', $config['wishlist_cookie_token']); $container->setParameter('bitbag_sylius_wishlist_plugin.parameters.allowed_mime_types', $config['allowed_mime_types']); @@ -36,6 +36,9 @@ public function prepend(ContainerBuilder $container): void { trigger_deprecation('bitbag/wishlist-plugin', '2.0', 'Doctrine migrations existing in a bundle will be removed, move migrations to the project directory.'); $this->prependDoctrineMigrations($container); + + $config = $this->getCurrentConfiguration($container); + $this->registerResources('bitbag_sylius_wishlist_plugin', 'doctrine/orm', $config['resources'], $container); } protected function getMigrationsNamespace(): string @@ -52,4 +55,13 @@ protected function getNamespacesOfMigrationsExecutedBefore(): array { return ['Sylius\Bundle\CoreBundle\Migrations']; } + + private function getCurrentConfiguration(ContainerBuilder $container): array + { + /** @var ConfigurationInterface $configuration */ + $configuration = $this->getConfiguration([], $container); + $configs = $container->getExtensionConfig($this->getAlias()); + + return $this->processConfiguration($configuration, $configs); + } }