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

LoaderResolver.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 1.55 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\Config\Loader;
13   
14  /**
15   * LoaderResolver selects a loader for a given resource.
16   *
17   * A resource can be anything (e.g. a full path to a config file or a Closure).
18   * Each loader determines whether it can load a resource and how.
19   *
20   * @author Fabien Potencier <fabien@symfony.com>
21   */
22  class LoaderResolver implements LoaderResolverInterface
23  {
24      /**
25       * @var LoaderInterface[] An array of LoaderInterface objects
26       */
27      private $loaders = [];
28   
29      /**
30       * @param LoaderInterface[] $loaders An array of loaders
31       */
32      public function __construct(array $loaders = [])
33      {
34          foreach ($loaders as $loader) {
35              $this->addLoader($loader);
36          }
37      }
38   
39      /**
40       * {@inheritdoc}
41       */
42      public function resolve($resource, $type = null)
43      {
44          foreach ($this->loaders as $loader) {
45              if ($loader->supports($resource, $type)) {
46                  return $loader;
47              }
48          }
49   
50          return false;
51      }
52   
53      public function addLoader(LoaderInterface $loader)
54      {
55          $this->loaders[] = $loader;
56          $loader->setResolver($this);
57      }
58   
59      /**
60       * Returns the registered loaders.
61       *
62       * @return LoaderInterface[] An array of LoaderInterface instances
63       */
64      public function getLoaders()
65      {
66          return $this->loaders;
67      }
68  }
69