File tree 2 files changed +21
-16
lines changed
2 files changed +21
-16
lines changed Original file line number Diff line number Diff line change 19
19
"license" : " MIT" ,
20
20
"require" : {
21
21
"php" : " ^7.2 | ^8.0" ,
22
- "illuminate/config" : " ^6.0 |^7.0|^8.0" ,
23
- "illuminate/console" : " ^6.0 |^7.0|^8.0" ,
24
- "illuminate/log" : " ^6.0 |^7.0|^8.0" ,
25
- "illuminate/support" : " ^6.0 |^7.0|^8.0" ,
22
+ "illuminate/config" : " ^6.10 |^7.0|^8.0" ,
23
+ "illuminate/console" : " ^6.10 |^7.0|^8.0" ,
24
+ "illuminate/log" : " ^6.10 |^7.0|^8.0" ,
25
+ "illuminate/support" : " ^6.10 |^7.0|^8.0" ,
26
26
"monolog/monolog" : " ^2.0"
27
27
},
28
28
"require-dev" : {
29
- "orchestra/testbench" : " ^4.0 |^5.0|^6.0" ,
29
+ "orchestra/testbench" : " ^4.10 |^5.0|^6.0" ,
30
30
"phpunit/phpunit" : " ^7.0|^8.0|^9.0"
31
31
},
32
32
"autoload" : {
Original file line number Diff line number Diff line change @@ -23,18 +23,9 @@ public function boot()
23
23
Commands \Rotate::class,
24
24
Commands \RotateFile::class,
25
25
]);
26
- }
27
-
28
- $ this ->app ->booted (function () {
29
- if (config ('rotate.schedule.enable ' , true )) {
30
- $ schedule = $ this ->app ->make (Schedule::class);
31
-
32
- $ cronOldVersion = config ('rotate.logs_rotate_schedule ' , '0 0 * * * ' );
33
- $ cron = config ('rotate.schedule.cron ' , $ cronOldVersion );
34
26
35
- $ schedule ->command ('rotate:logs ' )->cron ($ cron );
36
- }
37
- });
27
+ $ this ->registerSchedule ();
28
+ }
38
29
}
39
30
40
31
/**
@@ -46,4 +37,18 @@ public function register()
46
37
{
47
38
$ this ->mergeConfigFrom (__DIR__ .'/../config/rotate.php ' , 'rotate ' );
48
39
}
40
+
41
+ private function registerSchedule ()
42
+ {
43
+ if (! config ('rotate.schedule.enable ' , true )) {
44
+ return ;
45
+ }
46
+
47
+ $ this ->callAfterResolving (Schedule::class, function (Schedule $ schedule ) {
48
+ $ cronOldVersion = config ('rotate.logs_rotate_schedule ' , '0 0 * * * ' );
49
+ $ cron = config ('rotate.schedule.cron ' , $ cronOldVersion );
50
+
51
+ $ schedule ->command ('rotate:logs ' )->cron ($ cron );
52
+ });
53
+ }
49
54
}
You can’t perform that action at this time.
0 commit comments