aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Api_router.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/Zotlabs/Lib/Api_router.php b/Zotlabs/Lib/Api_router.php
new file mode 100644
index 000000000..404678bd9
--- /dev/null
+++ b/Zotlabs/Lib/Api_router.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace Zotlabs\Lib;
+
+
+class Api_router {
+
+ static private $routes = array();
+
+ static function register($path,$fn,$auth_required) {
+ self::$routes[$path] = [ 'func' => $fn, 'auth' => $auth_required ];
+ }
+
+ static function find($path) {
+ if(array_key_exists($path,self::$routes))
+ return self::$routes[$path];
+ return null;
+ }
+
+ static function dbg() {
+ return self::$routes;
+ }
+
+} \ No newline at end of file