aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Api_router.php
blob: 404678bd9cd98bfe2837f0472bb72e4bce469a34 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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;
	}

}