File tree Expand file tree Collapse file tree 2 files changed +21
-16
lines changed Expand file tree Collapse file tree 2 files changed +21
-16
lines changed Original file line number Diff line number Diff line change 1919 "license" : " MIT" ,
2020 "require" : {
2121 "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" ,
2626 "monolog/monolog" : " ^2.0"
2727 },
2828 "require-dev" : {
29- "orchestra/testbench" : " ^4.0 |^5.0|^6.0" ,
29+ "orchestra/testbench" : " ^4.10 |^5.0|^6.0" ,
3030 "phpunit/phpunit" : " ^7.0|^8.0|^9.0"
3131 },
3232 "autoload" : {
Original file line number Diff line number Diff line change @@ -23,18 +23,9 @@ public function boot()
2323 Commands \Rotate::class,
2424 Commands \RotateFile::class,
2525 ]);
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 );
3426
35- $ schedule ->command ('rotate:logs ' )->cron ($ cron );
36- }
37- });
27+ $ this ->registerSchedule ();
28+ }
3829 }
3930
4031 /**
@@ -46,4 +37,18 @@ public function register()
4637 {
4738 $ this ->mergeConfigFrom (__DIR__ .'/../config/rotate.php ' , 'rotate ' );
4839 }
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+ }
4954}
You can’t perform that action at this time.
0 commit comments