aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-10-21 21:52:48 +0200
committerJoas Schilling <nickvergessen@gmx.de>2013-10-21 21:52:48 +0200
commit51561ed538450d0e3d8392f3073004751e0b03f1 (patch)
treee56c4a40c07da1a09632cfd313d655f5d1fd9c8b /phpBB
parentbd86dea16c2f2d0d8ac6677777d612480186764a (diff)
downloadforums-51561ed538450d0e3d8392f3073004751e0b03f1.tar
forums-51561ed538450d0e3d8392f3073004751e0b03f1.tar.gz
forums-51561ed538450d0e3d8392f3073004751e0b03f1.tar.bz2
forums-51561ed538450d0e3d8392f3073004751e0b03f1.tar.xz
forums-51561ed538450d0e3d8392f3073004751e0b03f1.zip
[ticket/11948] Allow resource importing for routing
PHPBB3-11948
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions_url_matcher.php8
-rw-r--r--phpBB/phpbb/controller/provider.php7
2 files changed, 7 insertions, 8 deletions
diff --git a/phpBB/includes/functions_url_matcher.php b/phpBB/includes/functions_url_matcher.php
index fdde302e3b..c5d6815119 100644
--- a/phpBB/includes/functions_url_matcher.php
+++ b/phpBB/includes/functions_url_matcher.php
@@ -32,7 +32,7 @@ function phpbb_get_url_matcher(\phpbb\extension\finder $finder, RequestContext $
{
if (defined('DEBUG'))
{
- return phpbb_create_url_matcher($finder, $context);
+ return phpbb_create_url_matcher($finder, $context, $root_path);
}
if (!phpbb_url_matcher_dumped($root_path, $php_ext))
@@ -54,7 +54,7 @@ function phpbb_get_url_matcher(\phpbb\extension\finder $finder, RequestContext $
function phpbb_create_dumped_url_matcher(\phpbb\extension\finder $finder, $root_path, $php_ext)
{
$provider = new \phpbb\controller\provider();
- $routes = $provider->import_paths_from_finder($finder)->find();
+ $routes = $provider->import_paths_from_finder($finder)->find($root_path);
$dumper = new PhpMatcherDumper($routes);
$cached_url_matcher_dump = $dumper->dump(array(
'class' => 'phpbb_url_matcher',
@@ -70,10 +70,10 @@ function phpbb_create_dumped_url_matcher(\phpbb\extension\finder $finder, $root_
* @param RequestContext $context Symfony RequestContext object
* @return UrlMatcher
*/
-function phpbb_create_url_matcher(\phpbb\extension\finder $finder, RequestContext $context)
+function phpbb_create_url_matcher(\phpbb\extension\finder $finder, RequestContext $context, $root_path)
{
$provider = new \phpbb\controller\provider();
- $routes = $provider->import_paths_from_finder($finder)->find();
+ $routes = $provider->import_paths_from_finder($finder)->find($root_path);
return new UrlMatcher($routes, $context);
}
diff --git a/phpBB/phpbb/controller/provider.php b/phpBB/phpbb/controller/provider.php
index 7ea0c973fe..048ca72084 100644
--- a/phpBB/phpbb/controller/provider.php
+++ b/phpBB/phpbb/controller/provider.php
@@ -56,8 +56,7 @@ class provider
// because the finder cannot find it
$this->routing_files = array_merge(array('config/routing.yml'), array_keys($finder
->directory('config')
- ->prefix('routing')
- ->suffix('.yml')
+ ->suffix('routing.yml')
->find()
));
@@ -75,8 +74,8 @@ class provider
$routes = new RouteCollection;
foreach ($this->routing_files as $file_path)
{
- $loader = new YamlFileLoader(new FileLocator(dirname($base_path . $file_path)));
- $routes->addCollection($loader->load(basename($file_path)));
+ $loader = new YamlFileLoader(new FileLocator($base_path));
+ $routes->addCollection($loader->load($file_path));
}
return $routes;