From 63f6d2d558f4b999f3851482122f3e3589ce4cfc Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 1 Aug 2016 16:37:48 +0200 Subject: Allow ocs/v2.php/cloud/... routes One of the possibilities of the old OCS API is that you can define the url yourself. This PR makes this possible again by adding an optional root elemenet to the route. Routes are thus: .../ocs/v2.php// By default = apps/ This will allow for example the provisioning API etc to be in ../ovs/v2/php/cloud/users --- lib/private/AppFramework/Routing/RouteConfig.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/private/AppFramework/Routing/RouteConfig.php') diff --git a/lib/private/AppFramework/Routing/RouteConfig.php b/lib/private/AppFramework/Routing/RouteConfig.php index 066c0da1138..e94f2e50c1d 100644 --- a/lib/private/AppFramework/Routing/RouteConfig.php +++ b/lib/private/AppFramework/Routing/RouteConfig.php @@ -86,7 +86,13 @@ class RouteConfig { $postfix = $ocsRoute['postfix']; } - $url = $ocsRoute['url']; + if (isset($ocsRoute['root'])) { + $root = $ocsRoute['root']; + } else { + $root = '/apps/'.$this->appName; + } + + $url = $root . $ocsRoute['url']; $verb = isset($ocsRoute['verb']) ? strtoupper($ocsRoute['verb']) : 'GET'; $split = explode('#', $name, 2); -- cgit v1.2.3