From 9e80f0954d45465dfba261c5b5a501e77eb595c9 Mon Sep 17 00:00:00 2001
From: Bart Visscher <bartv@thisnet.nl>
Date: Mon, 30 Jul 2012 20:48:03 +0200
Subject: [PATCH] Add loading of routes in OC_Router

---
 lib/router.php | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lib/router.php b/lib/router.php
index f037ecdfef..4b6b076e21 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -16,6 +16,19 @@ class OC_Router {
 	protected $collections = array();
 	protected $collection = null;
 
+	/**
+	 * loads the api routes
+	 */
+	public function loadRoutes(){
+		// TODO cache
+		foreach(OC_APP::getEnabledApps() as $app){
+			$file = OC_App::getAppPath($app).'/appinfo/routes.php';
+			if(file_exists($file)){
+				require_once($file);
+			}
+		}
+	}
+
 	public function useCollection($name) {
 		if (!isset($this->collections[$name])) {
 			$this->collections[$name] = new RouteCollection();
-- 
GitLab