aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Route
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-08-05 09:49:18 +0200
committernpmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>2020-08-05 12:52:16 +0000
commitea8f68bea6957ae459ff1ba6849b25354b3f0093 (patch)
treeb6523d1ad1c01e55622fd31bfcfb27daabec0593 /lib/private/Route
parentd98f7c1bd83fc03fd297ebeac6279ffe17316950 (diff)
downloadnextcloud-server-ea8f68bea6957ae459ff1ba6849b25354b3f0093.tar.gz
nextcloud-server-ea8f68bea6957ae459ff1ba6849b25354b3f0093.zip
Hand in the route and the parameters of the request
Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'lib/private/Route')
-rw-r--r--lib/private/Route/Router.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php
index de7c720f271..6de581ffa96 100644
--- a/lib/private/Route/Router.php
+++ b/lib/private/Route/Router.php
@@ -239,9 +239,9 @@ class Router implements IRouter {
*
* @param string $url The url to find
* @throws \Exception
- * @return void
+ * @return array
*/
- public function match($url) {
+ public function findMatchingRoute(string $url): array {
if (substr($url, 0, 6) === '/apps/') {
// empty string / 'apps' / $app / rest of the route
list(, , $app,) = explode('/', $url, 4);
@@ -287,6 +287,19 @@ class Router implements IRouter {
}
}
+ return $parameters;
+ }
+
+ /**
+ * Find and execute the route matching $url
+ *
+ * @param string $url The url to find
+ * @throws \Exception
+ * @return void
+ */
+ public function match($url) {
+ $parameters = $this->findMatchingRoute($url);
+
\OC::$server->getEventLogger()->start('run_route', 'Run route');
if (isset($parameters['caller'])) {
$caller = $parameters['caller'];