summaryrefslogtreecommitdiffstats
path: root/lib/private/appframework
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-16 15:45:55 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-16 15:45:55 +0200
commitfdeef5e874ae7a8e4a23a737e5a1e948804d768a (patch)
tree2cc093162b583210b8f878f5ab9d670c270cff2e /lib/private/appframework
parent60541358ac375652d74e4a5b5d8cad865833aa92 (diff)
parentc3f7d22adc59949ad41c33d450b6d3e226cdefdb (diff)
downloadnextcloud-server-fdeef5e874ae7a8e4a23a737e5a1e948804d768a.tar.gz
nextcloud-server-fdeef5e874ae7a8e4a23a737e5a1e948804d768a.zip
Merge branch 'master' into fixing-appframework-master
Conflicts: lib/private/appframework/middleware/security/securitymiddleware.php tests/lib/appframework/middleware/security/SecurityMiddlewareTest.php
Diffstat (limited to 'lib/private/appframework')
-rw-r--r--lib/private/appframework/app.php5
-rw-r--r--lib/private/appframework/dependencyinjection/dicontainer.php9
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/private/appframework/app.php b/lib/private/appframework/app.php
index 7ff55bb809d..6d3effbf1fa 100644
--- a/lib/private/appframework/app.php
+++ b/lib/private/appframework/app.php
@@ -42,12 +42,9 @@ class App {
* @param string $controllerName the name of the controller under which it is
* stored in the DI container
* @param string $methodName the method that you want to call
- * @param array $urlParams an array with variables extracted from the routes
* @param DIContainer $container an instance of a pimple container.
*/
- public static function main($controllerName, $methodName, array $urlParams,
- IAppContainer $container) {
- $container['urlParams'] = $urlParams;
+ public static function main($controllerName, $methodName, IAppContainer $container) {
$controller = $container[$controllerName];
// initialize the dispatcher and run all the middleware before the controller
diff --git a/lib/private/appframework/dependencyinjection/dicontainer.php b/lib/private/appframework/dependencyinjection/dicontainer.php
index 7276a11e4d9..81910df6990 100644
--- a/lib/private/appframework/dependencyinjection/dicontainer.php
+++ b/lib/private/appframework/dependencyinjection/dicontainer.php
@@ -50,9 +50,10 @@ class DIContainer extends SimpleContainer implements IAppContainer{
* Put your class dependencies in here
* @param string $appName the name of the app
*/
- public function __construct($appName){
+ public function __construct($appName, $urlParams = array()){
$this['AppName'] = $appName;
+ $this['urlParams'] = $urlParams;
$this->registerParameter('ServerContainer', \OC::$server);
@@ -67,6 +68,7 @@ class DIContainer extends SimpleContainer implements IAppContainer{
/** @var $c SimpleContainer */
/** @var $server IServerContainer */
$server = $c->query('ServerContainer');
+ $server->registerParameter('urlParams', $c['urlParams']);
return $server->getRequest();
});
@@ -90,11 +92,12 @@ class DIContainer extends SimpleContainer implements IAppContainer{
return new SecurityMiddleware($this, $c['Request']);
});
- $this['MiddlewareDispatcher'] = $this->share(function($c){
+ $middleWares = $this->middleWares;
+ $this['MiddlewareDispatcher'] = $this->share(function($c) use ($middleWares) {
$dispatcher = new MiddlewareDispatcher();
$dispatcher->registerMiddleware($c['SecurityMiddleware']);
- foreach($this->middleWares as $middleWare) {
+ foreach($middleWares as $middleWare) {
$dispatcher->registerMiddleware($middleWare);
}