aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Api_router.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-08-11 17:02:52 -0700
committerredmatrix <git@macgirvin.com>2016-08-11 17:02:52 -0700
commit3ba4b2c1c1ffa8275337857e10c250b338e15170 (patch)
tree17fad3ad9776e5ac823671af250ddaef9b33a784 /Zotlabs/Lib/Api_router.php
parente985436b3be0a6c0cdb3de57c61de16a25cc0de5 (diff)
downloadvolse-hubzilla-3ba4b2c1c1ffa8275337857e10c250b338e15170.tar.gz
volse-hubzilla-3ba4b2c1c1ffa8275337857e10c250b338e15170.tar.bz2
volse-hubzilla-3ba4b2c1c1ffa8275337857e10c250b338e15170.zip
A bit of api cleanup. Don't get excited. This is like a 0.005% cleanup but you have to start somewhere.
Diffstat (limited to 'Zotlabs/Lib/Api_router.php')
-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