1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
<?php
require_once __DIR__.'/../init.php';
$router = new router;
$router->add('routing/', 'Modem routing_smallhome_page');
$router->add('routing/switch-small-home/', 'Modem routing_smallhome_switch');
$router->add('routing/{ipsets,dhcp}/', 'Modem routing_${1}_page');
$router->add('routing/ipsets/{add,del}/', 'Modem routing_ipsets_${1}');
$router->add('sms/', 'Modem sms');
// $router->add('modem/set.ajax', 'Modem ctl_set_ajax');
// inverter
$router->add('inverter/set-osp/', 'Inverter set_osp');
// misc
$router->add('/', 'Misc main');
$router->add('sensors/', 'Misc sensors_page');
$router->add('pump/', 'Misc pump_page');
$router->add('phpinfo/', 'Misc phpinfo');
$router->add('cams/', 'Misc cams');
$router->add('cams/([\d,]+)/', 'Misc cams id=$(1)');
$router->add('cams/stat/', 'Misc cams_stat');
$router->add('debug/', 'Misc debug');
// auth
$router->add('auth/', 'Auth auth');
$router->add('deauth/', 'Auth deauth');
$route = routerFind($router);
if ($route === false)
(new FakeRequestHandler)->dispatch('404');
list($handler, $act, $RouterInput) = $route;
$handler_class = $handler.'Handler';
if (!class_exists($handler_class)) {
debugError('index.php: class '.$handler_class.' not found');
(new FakeRequestHandler)->dispatch('404');
}
(new $handler_class)->dispatch($act);
|