1: | <?php |
2: | declare(strict_types=1); |
3: | /** |
4: | * +------------------------------------------------------------+ |
5: | * | apnscp | |
6: | * +------------------------------------------------------------+ |
7: | * | Copyright (c) Apis Networks | |
8: | * +------------------------------------------------------------+ |
9: | * | Licensed under Artistic License 2.0 | |
10: | * +------------------------------------------------------------+ |
11: | * | Author: Matt Saladna (msaladna@apisnetworks.com) | |
12: | * +------------------------------------------------------------+ |
13: | */ |
14: | |
15: | /** |
16: | * Log viewing and manipulation |
17: | * |
18: | * @package core |
19: | */ |
20: | class Log_Module extends Module_Skeleton |
21: | { |
22: | public function tail($type) |
23: | { |
24: | $c = 'Log_' . ucwords($type); |
25: | if (!class_exists($c)) { |
26: | return error("unknown log type `%s'", $c); |
27: | } |
28: | $type = new $c; |
29: | |
30: | return $c->watch(); |
31: | } |
32: | |
33: | public function filter($type, $filter) |
34: | { |
35: | $c = 'Log_' . ucwords($type); |
36: | if (!class_exists($c)) { |
37: | return error("unknown log type `%s'", $c); |
38: | } |
39: | $type = new $c; |
40: | |
41: | return $c->filter($filter); |
42: | } |
43: | |
44: | public function get_supported_logs() |
45: | { |
46: | $dir = opendir(INCLUDE_PATH . DIRECTORY_SEPARATOR . 'Log'); |
47: | } |
48: | |
49: | } |
50: | |
51: | ?> |
52: |