aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/routing/loader_resolver.php
diff options
context:
space:
mode:
authorMáté Bartus <mate.bartus@gmail.com>2015-10-08 14:55:23 +0200
committerMáté Bartus <mate.bartus@gmail.com>2015-10-08 14:55:23 +0200
commitce2caf248cd0653b8a4304341415e9401abdf416 (patch)
tree18aeb27b2a7f78b780c8152f5a12430c956ed699 /phpBB/phpbb/routing/loader_resolver.php
parenta0ba6b7dc6411d5fd6aee9b17cb176905af0482a (diff)
parent403c647b9e84640977ca0f98d21d15ceb4957bdb (diff)
downloadforums-ce2caf248cd0653b8a4304341415e9401abdf416.tar
forums-ce2caf248cd0653b8a4304341415e9401abdf416.tar.gz
forums-ce2caf248cd0653b8a4304341415e9401abdf416.tar.bz2
forums-ce2caf248cd0653b8a4304341415e9401abdf416.tar.xz
forums-ce2caf248cd0653b8a4304341415e9401abdf416.zip
Merge pull request #3948 from Nicofuma/ticket/14220
[ticket/14220] Move route loading to services
Diffstat (limited to 'phpBB/phpbb/routing/loader_resolver.php')
-rw-r--r--phpBB/phpbb/routing/loader_resolver.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/phpBB/phpbb/routing/loader_resolver.php b/phpBB/phpbb/routing/loader_resolver.php
new file mode 100644
index 0000000000..e335051444
--- /dev/null
+++ b/phpBB/phpbb/routing/loader_resolver.php
@@ -0,0 +1,49 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\routing;
+
+use Symfony\Component\Config\Loader\LoaderResolverInterface;
+
+/**
+ * @see Symfony\Component\Config\Loader\LoaderResolver
+ */
+class loader_resolver implements LoaderResolverInterface
+{
+ /**
+ * @var \Symfony\Component\Config\Loader\LoaderInterface[] An array of LoaderInterface objects
+ */
+ protected $loaders = [];
+
+ public function __construct($loaders = [])
+ {
+ $this->loaders = $loaders;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function resolve($resource, $type = null)
+ {
+ /** @var \Symfony\Component\Config\Loader\LoaderInterface $loader */
+ foreach ($this->loaders as $loader)
+ {
+ if ($loader->supports($resource, $type))
+ {
+ return $loader;
+ }
+ }
+
+ return false;
+ }
+}