-
Notifications
You must be signed in to change notification settings - Fork 0
/
extend.php
42 lines (33 loc) · 1.21 KB
/
extend.php
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
<?php
/*
* This file is part of ianm/log-viewer.
*
* Copyright (c) 2022 IanM.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace IanM\LogViewer;
use Flarum\Extend;
use Illuminate\Console\Scheduling\Event;
return [
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js')
->css(__DIR__.'/less/admin.less'),
new Extend\Locales(__DIR__.'/locale'),
(new Extend\Routes('api'))
->get('/logs', 'logs.index', Api\Controller\ListLogfilesController::class)
->get('/logs/{file}', 'logs.show', Api\Controller\ShowLogFileController::class),
(new Extend\Settings())
->default('ianm-log-viewer.purge-days', 90)
->default('ianm-log-viewer.max-file-size', 1),
(new Extend\Console())
->command(Console\CleanupLogfilesCommand::class)
->command(Console\SplitLargeLogfilesCommand::class)
->schedule(Console\CleanupLogfilesCommand::class, function (Event $schedule) {
$schedule->daily();
})
->schedule(Console\SplitLargeLogfilesCommand::class, function (Event $schedule) {
$schedule->daily();
}),
];