Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

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

Loader.php

Zuletzt modifiziert: 09.10.2024, 12:58 - Dateigröße: 1.95 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  use Symfony\Component\Config\Exception\FileLoaderLoadException;
15   
16  /**
17   * Loader is the abstract class used by all built-in loaders.
18   *
19   * @author Fabien Potencier <fabien@symfony.com>
20   */
21  abstract class Loader implements LoaderInterface
22  {
23      protected $resolver;
24   
25      /**
26       * Gets the loader resolver.
27       *
28       * @return LoaderResolverInterface A LoaderResolverInterface instance
29       */
30      public function getResolver()
31      {
32          return $this->resolver;
33      }
34   
35      /**
36       * Sets the loader resolver.
37       *
38       * @param LoaderResolverInterface $resolver A LoaderResolverInterface instance
39       */
40      public function setResolver(LoaderResolverInterface $resolver)
41      {
42          $this->resolver = $resolver;
43      }
44   
45      /**
46       * Imports a resource.
47       *
48       * @param mixed  $resource A Resource
49       * @param string $type     The resource type
50       *
51       * @return mixed
52       */
53      public function import($resource, $type = null)
54      {
55          return $this->resolve($resource, $type)->load($resource, $type);
56      }
57   
58      /**
59       * Finds a loader able to load an imported resource.
60       *
61       * @param mixed  $resource A Resource
62       * @param string $type     The resource type
63       *
64       * @return LoaderInterface A LoaderInterface instance
65       *
66       * @throws FileLoaderLoadException if no loader is found
67       */
68      public function resolve($resource, $type = null)
69      {
70          if ($this->supports($resource, $type)) {
71              return $this;
72          }
73   
74          $loader = null === $this->resolver ? false : $this->resolver->resolve($resource, $type);
75   
76          if (false === $loader) {
77              throw new FileLoaderLoadException($resource);
78          }
79   
80          return $loader;
81      }
82  }
83