From 9dbe5f3703afd84c701d0d1347c06f1b07ff7fe6 Mon Sep 17 00:00:00 2001
From: Tom Needham <needham.thomas@gmail.com>
Date: Sat, 28 Jul 2012 21:57:24 +0000
Subject: [PATCH] Load routes before calling actions

---
 lib/api.php | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/api.php b/lib/api.php
index eaa2bb42f8..cf40167b07 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -53,6 +53,15 @@ class OC_API {
 	*/
 	public function call($parameters){
 		
+		// Get the routes
+		// TODO cache
+		foreach(OC_APP::getEnabledApps() as $app){
+			$file = OC_App::getAppPath($app).'/appinfo/routes.php';
+			if(file_exists($file)){
+				require_once($file);
+			}
+		}
+		
 		$name = $parameters['_name'];
 		$response = array();
 		// Loop through registered actions
-- 
GitLab