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

URLHandlerPass.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler;
8
9 use LogicException;
10 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
11 use Symfony\Component\DependencyInjection\ContainerBuilder;
12 use Symfony\Component\DependencyInjection\Reference;
13
17 class URLHandlerPass implements CompilerPassInterface
18 {
22 public function process(ContainerBuilder $container)
23 {
24 if (!$container->hasDefinition('ezpublish.url_checker.handler_registry')) {
25 return;
26 }
27
28 $definition = $container->findDefinition('ezpublish.url_checker.handler_registry');
29 foreach ($container->findTaggedServiceIds('ezpublish.url_handler') as $id => $attributes) {
30 foreach ($attributes as $attribute) {
31 if (!isset($attribute['scheme'])) {
32 throw new LogicException(sprintf(
33 '%s service tag needs a "scheme" attribute to identify which scheme is supported by handler. None given.',
34 'ezpublish.url_handler'
35 ));
36 }
37
38 $definition->addMethodCall('addHandler', [
39 $attribute['scheme'],
40 new Reference($id),
41 ]);
42 }
43 }
44 }
45 }
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\URLHandlerPass
This compiler pass will register URL handlers.
Definition: URLHandlerPass.php:18
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\URLHandlerPass\process
process(ContainerBuilder $container)
{}
Definition: URLHandlerPass.php:22
eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler
Definition: AsseticPass.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.