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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

AutoAliasServicePass.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 1.34 KiB


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\Alias;
15  use Symfony\Component\DependencyInjection\ContainerBuilder;
16  use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
17   
18  /**
19   * Sets a service to be an alias of another one, given a format pattern.
20   */
21  class AutoAliasServicePass implements CompilerPassInterface
22  {
23      /**
24       * {@inheritdoc}
25       */
26      public function process(ContainerBuilder $container)
27      {
28          foreach ($container->findTaggedServiceIds('auto_alias') as $serviceId => $tags) {
29              foreach ($tags as $tag) {
30                  if (!isset($tag['format'])) {
31                      throw new InvalidArgumentException(sprintf('Missing tag information "format" on auto_alias service "%s".', $serviceId));
32                  }
33   
34                  $aliasId = $container->getParameterBag()->resolveValue($tag['format']);
35                  if ($container->hasDefinition($aliasId) || $container->hasAlias($aliasId)) {
36                      $container->setAlias($serviceId, new Alias($aliasId, true));
37                  }
38              }
39          }
40      }
41  }
42