Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

RegisterStorageEnginePass.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler;
8
9 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
10 use Symfony\Component\DependencyInjection\ContainerBuilder;
11 use LogicException;
12 use Symfony\Component\DependencyInjection\Reference;
13
17 class RegisterStorageEnginePass implements CompilerPassInterface
18 {
29 public function process(ContainerBuilder $container)
30 {
31 if (!$container->hasDefinition('ezpublish.api.storage_engine.factory')) {
32 return;
33 }
34
35 $storageEngineFactoryDef = $container->getDefinition('ezpublish.api.storage_engine.factory');
36 foreach ($container->findTaggedServiceIds('ezpublish.storageEngine') as $id => $attributes) {
37 foreach ($attributes as $attribute) {
38 if (!isset($attribute['alias'])) {
39 throw new LogicException('ezpublish.storageEngine service tag needs an "alias" attribute to identify the storage engine. None given.');
40 }
41
42 // Register the storage engine on the main storage engine factory
43 $storageEngineFactoryDef->addMethodCall(
44 'registerStorageEngine',
45 [
46 new Reference($id),
47 $attribute['alias'],
48 ]
49 );
50 }
51 }
52 }
53 }
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\RegisterStorageEnginePass
This compiler pass will register eZ Publish storage engines.
Definition: RegisterStorageEnginePass.php:18
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\RegisterStorageEnginePass\process
process(ContainerBuilder $container)
Performs compiler passes for persistence factories.
Definition: RegisterStorageEnginePass.php:29
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler
Definition: AsseticPass.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.