A bit of api cleanup. Don't get excited. This is like a 0.005% cleanup but you have to start somewhere.

This commit is contained in:
redmatrix
2016-08-11 17:02:52 -07:00
parent e985436b3b
commit 3ba4b2c1c1
4 changed files with 174 additions and 118 deletions

View File

@@ -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;
}
}