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 |
RoutingConfigurator.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\Routing\Loader\Configurator;
13
14 use Symfony\Component\Routing\Loader\PhpFileLoader;
15 use Symfony\Component\Routing\RouteCollection;
16
17 /**
18 * @author Nicolas Grekas <p@tchwork.com>
19 */
20 class RoutingConfigurator
21 {
22 use Traits\AddTrait;
23
24 private $loader;
25 private $path;
26 private $file;
27
28 public function __construct(RouteCollection $collection, PhpFileLoader $loader, $path, $file)
29 {
30 $this->collection = $collection;
31 $this->loader = $loader;
32 $this->path = $path;
33 $this->file = $file;
34 }
35
36 /**
37 * @return ImportConfigurator
38 */
39 final public function import($resource, $type = null, $ignoreErrors = false)
40 {
41 $this->loader->setCurrentDir(\dirname($this->path));
42 $imported = $this->loader->import($resource, $type, $ignoreErrors, $this->file) ?: [];
43
44 if (!\is_array($imported)) {
45 return new ImportConfigurator($this->collection, $imported);
46 }
47
48 $mergedCollection = new RouteCollection();
49 foreach ($imported as $subCollection) {
50 $mergedCollection->addCollection($subCollection);
51 }
52
53 return new ImportConfigurator($this->collection, $mergedCollection);
54 }
55
56 /**
57 * @return CollectionConfigurator
58 */
59 final public function collection($name = '')
60 {
61 return new CollectionConfigurator($this->collection, $name);
62 }
63 }
64