Merge pull request #8138 from owncloud/allow-app-in-routes.php

To isolate the variable scope used inside the $file it is required in it...
This commit is contained in:
Thomas Müller 2014-04-10 16:09:23 +02:00
commit ecd74d3630
1 changed files with 9 additions and 1 deletions

View File

@ -117,7 +117,7 @@ class Router implements IRouter {
if (!isset($this->loadedApps[$app])) {
$this->loadedApps[$app] = true;
$this->useCollection($app);
require_once $file;
$this->requireRouteFile($file);
$collection = $this->getCollection($app);
$collection->addPrefix('/apps/' . $app);
$this->root->addCollection($collection);
@ -230,4 +230,12 @@ class Router implements IRouter {
return $this->getGenerator()->generate($name, $parameters, $absolute);
}
/**
* To isolate the variable scope used inside the $file it is required in it's own method
* @param $file
*/
private function requireRouteFile($file) {
require_once $file;
}
}