‡/û²¥Ü<ˆ/ ³¥Ü<r/Ü¥Ü<ÿÿÿÿÿÿÿÿtionsRegistered = true; foreach (self::ADDITIONAL_BUNDLES as $bundle) { $bundle::registerMigrations($migrationSource); } } public static function getInstance(): self { if (!self::$instance) { self::$instance = new self(); } return self::$instance; } public function build(ContainerBuilder $containerBuilder): void { parent::build($containerBuilder); $loader = new XmlFileLoader($containerBuilder, new FileLocator(__DIR__)); $loader->load('AddressCorrecting/DependencyInjection/service.xml'); $loader->load('Carrier/DependencyInjection/model.xml'); $loader->load('Carrier/DependencyInjection/model-extension.xml'); $loader->load('Carrier/DependencyInjection/model-subscriber.xml'); $loader->load('Carrier/DependencyInjection/service.xml'); $loader->load('Config/DependencyInjection/command.xml'); $loader->load('Config/DependencyInjection/model.xml'); $loader->load('Config/DependencyInjection/model-extension.xml'); $loader->load('Config/DependencyInjection/service.xml'); $loader->load('DemodataGeneration/DependencyInjection/command.xml'); $loader->load('Logging/DependencyInjection/service.xml'); $loader->load('Mail/DependencyInjection/controller.xml'); $loader->load('Mail/DependencyInjection/service.xml'); $loader->load('Notifications/DependencyInjection/service.xml'); $loader->load('ParcelPacking/DependencyInjection/service.xml'); $loader->load('ParcelHydration/DependencyInjection/service.xml'); $loader->load('Shipment/DependencyInjection/controller.xml'); $loader->load('Shipment/DependencyInjection/model.xml'); $loader->load('Shipment/DependencyInjection/model-extension.xml'); $loader->load('Shipment/DependencyInjection/service.xml'); $containerBuilder->addCompilerPass(new CarrierAdapterRegistryCompilerPass()); // Register test services. Should never be loaded in production. if (in_array(ShopwareIntegrationTestPlugin::class, $containerBuilder->getParameter('kernel.bundles'), true)) { $loader->load('../test/TestEntityCreation/DependencyInjection/service.xml'); } } public function shutdown(): void { parent::shutdown(); // Shopware may reboot the kernel under certain circumstances (e.g. plugin un-/installation) within a single // request. After the kernel was rebooted, our bundles have to be registered again. // We reset the registration flag when the kernel is shut down. This will cause the bundles to be registered // again in the (re)boot process. self::$registered = false; } public function install(InstallContext $installContext): void { BundleInstaller::createForContainerAndClass($this->container, self::class) ->install(self::ADDITIONAL_BUNDLES, $installContext); } public function onAfterActivate(InstallContext $installContext): void { PickwareShippingBundleInstaller::createFromContainer($this->container)->install($installContext); BundleInstaller::createForContainerAndClass($this->container, self::class) ->onAfterActivate(self::ADDITIONAL_BUNDLES, $installContext); } public function uninstall(UninstallContext $uninstallContext): void { if ($uninstallContext->keepUserData()) { return; } DependencyAwareTableDropper::createForContainer($this->container)->dropTables([ 'pickware_shipping_carrier', 'pickware_shipping_document_shipment_mapping', 'pickware_shipping_document_tracking_code_mapping', 'pickware_shipping_shipment', 'pickware_shipping_shipment_order_mapping', 'pickware_shipping_shipping_method_config', 'pickware_shipping_tracking_code', ]); // We need eight backslashes, as we need to match a single one and double the count for each of the following: // 1. The PHP parser // 2. The MySQL parser // 3. The MySQL pattern matcher (only when using LIKE) $this->container->get(Connection::class) ->executeStatement("DELETE FROM `migration` WHERE `class` LIKE 'Pickware\\\\\\\\ShippingBundle\\\\\\\\%'"); PickwareShippingBundleInstaller::createFromContainer($this->container)->uninstall(); BundleInstaller::createForContainerAndClass($this->container, self::class)->uninstall($uninstallContext); } }