Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
ResolveHotPathPass.php
01 <?php
02
03 /*
04 * This file is part of the Symfony package.
05 *
06 * (c) Fabien Potencier <fabien@symfony.com>
07 *
08 * For the full copyright and license information, please view the LICENSE
09 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\DependencyInjection\Compiler;
13
14 use Symfony\Component\DependencyInjection\Argument\ArgumentInterface;
15 use Symfony\Component\DependencyInjection\ContainerBuilder;
16 use Symfony\Component\DependencyInjection\Definition;
17 use Symfony\Component\DependencyInjection\Reference;
18
19 /**
20 * Propagate "container.hot_path" tags to referenced services.
21 *
22 * @author Nicolas Grekas <p@tchwork.com>
23 */
24 class ResolveHotPathPass extends AbstractRecursivePass
25 {
26 private $tagName;
27 private $resolvedIds = [];
28
29 public function __construct($tagName = 'container.hot_path')
30 {
31 $this->tagName = $tagName;
32 }
33
34 /**
35 * {@inheritdoc}
36 */
37 public function process(ContainerBuilder $container)
38 {
39 try {
40 parent::process($container);
41 $container->getDefinition('service_container')->clearTag($this->tagName);
42 } finally {
43 $this->resolvedIds = [];
44 }
45 }
46
47 /**
48 * {@inheritdoc}
49 */
50 protected function processValue($value, $isRoot = false)
51 {
52 if ($value instanceof ArgumentInterface) {
53 return $value;
54 }
55 if ($value instanceof Definition && $isRoot && (isset($this->resolvedIds[$this->currentId]) || !$value->hasTag($this->tagName) || $value->isDeprecated())) {
56 return $value->isDeprecated() ? $value->clearTag($this->tagName) : $value;
57 }
58 if ($value instanceof Reference && ContainerBuilder::IGNORE_ON_UNINITIALIZED_REFERENCE !== $value->getInvalidBehavior() && $this->container->has($id = $this->container->normalizeId($value))) {
59 $definition = $this->container->findDefinition($id);
60 if (!$definition->hasTag($this->tagName) && !$definition->isDeprecated()) {
61 $this->resolvedIds[$id] = true;
62 $definition->addTag($this->tagName);
63 parent::processValue($definition, false);
64 }
65
66 return $value;
67 }
68
69 return parent::processValue($value, $isRoot);
70 }
71 }
72