[Pkg-owncloud-commits] [owncloud] 101/239: fix appframework routing

David Prévot taffit at moszumanska.debian.org
Fri Nov 29 01:32:24 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 993fea2f05ae300fd1036d2a82ba02413f2649d4
Author: Thomas Müller <thomas.mueller at tmit.eu>
Date:   Mon Nov 25 11:36:33 2013 +0100

    fix appframework routing
---
 lib/private/appframework/app.php                        |  5 ++++-
 lib/private/appframework/routing/routeactionhandler.php |  2 +-
 lib/public/appframework/app.php                         | 11 +++++++++++
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/lib/private/appframework/app.php b/lib/private/appframework/app.php
index 6d3effb..7d32403 100644
--- a/lib/private/appframework/app.php
+++ b/lib/private/appframework/app.php
@@ -44,7 +44,10 @@ class App {
 	 * @param string $methodName the method that you want to call
 	 * @param DIContainer $container an instance of a pimple container.
 	 */
-	public static function main($controllerName, $methodName, IAppContainer $container) {
+	public static function main($controllerName, $methodName, DIContainer $container, array $urlParams = null) {
+		if (!is_null($urlParams)) {
+			$container['urlParams'] = $urlParams;
+		}
 		$controller = $container[$controllerName];
 
 		// initialize the dispatcher and run all the middleware before the controller
diff --git a/lib/private/appframework/routing/routeactionhandler.php b/lib/private/appframework/routing/routeactionhandler.php
index 7fb56f1..2b9dc38 100644
--- a/lib/private/appframework/routing/routeactionhandler.php
+++ b/lib/private/appframework/routing/routeactionhandler.php
@@ -37,6 +37,6 @@ class RouteActionHandler {
 	}
 
 	public function __invoke($params) {
-		App::main($this->controllerName, $this->actionName, $params, $this->container);
+		App::main($this->controllerName, $this->actionName, $this->container, $params);
 	}
 }
diff --git a/lib/public/appframework/app.php b/lib/public/appframework/app.php
index 6ac48bf..1f82f8d 100644
--- a/lib/public/appframework/app.php
+++ b/lib/public/appframework/app.php
@@ -21,6 +21,7 @@
  */
 
 namespace OCP\AppFramework;
+use OC\AppFramework\routing\RouteConfig;
 
 
 /**
@@ -48,6 +49,16 @@ class App {
 	}
 
 	/**
+	 * This function is to be called
+	 * @param \OC_Router $router
+	 * @param array $routes
+	 */
+	public function registerRoutes($router, $routes) {
+		$routeConfig = new RouteConfig($this->container, $router, $routes);
+		$routeConfig->register();
+	}
+
+	/**
 	 * This function is called by the routing component to fire up the frameworks dispatch mechanism.
 	 *
 	 * Example code in routes.php of the task app:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list