Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

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: 09.10.2024, 12:56 - Dateigröße: 1.69 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 = array();
 28   
 29      /**
 30       * Constructor.
 31       *
 32       * @param LoaderInterface[] $loaders An array of loaders
 33       */
 34      public function __construct(array $loaders = array())
 35      {
 36          foreach ($loaders as $loader) {
 37              $this->addLoader($loader);
 38          }
 39      }
 40   
 41      /**
 42       * {@inheritdoc}
 43       */
 44      public function resolve($resource, $type = null)
 45      {
 46          foreach ($this->loaders as $loader) {
 47              if ($loader->supports($resource, $type)) {
 48                  return $loader;
 49              }
 50          }
 51   
 52          return false;
 53      }
 54   
 55      /**
 56       * Adds a loader.
 57       *
 58       * @param LoaderInterface $loader A LoaderInterface instance
 59       */
 60      public function addLoader(LoaderInterface $loader)
 61      {
 62          $this->loaders[] = $loader;
 63          $loader->setResolver($this);
 64      }
 65   
 66      /**
 67       * Returns the registered loaders.
 68       *
 69       * @return LoaderInterface[] An array of LoaderInterface instances
 70       */
 71      public function getLoaders()
 72      {
 73          return $this->loaders;
 74      }
 75  }
 76