File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,5 +36,11 @@ public function init(
3636 new \ilLoggingSetupAgent (
3737 $ pull [\ILIAS \Refinery \Factory::class]
3838 );
39+ $ contribute [\ILIAS \Cron \CronJob::class] = static fn () =>
40+ new \ilLoggerCronCleanErrorFiles (
41+ 'components \\' . self ::class,
42+ $ use [\ILIAS \Language \Language::class],
43+ true
44+ );
3945 }
4046}
Original file line number Diff line number Diff line change 11<?php
22
3- declare (strict_types=1 );
4-
5- use ILIAS \Cron \Schedule \CronJobScheduleType ;
6-
73/**
84 * This file is part of ILIAS, a powerful learning management system
95 * published by ILIAS open source e-Learning e.V.
2016 *
2117 *********************************************************************/
2218
19+ declare (strict_types=1 );
20+
21+ use ILIAS \Cron \Schedule \CronJobScheduleType ;
22+
2323class ilLoggerCronCleanErrorFiles extends ilCronJob
2424{
2525 protected const DEFAULT_VALUE_OLDER_THAN = 31 ;
2626
27- protected ilLanguage $ lng ;
2827 protected ilSetting $ settings ;
2928 protected ilLoggingErrorSettings $ error_settings ;
3029
31- public function __construct ()
30+ public function __construct (
31+ string $ component ,
32+ \ILIAS \Language \Language $ lng ,
33+ bool $ registration = false
34+ ) {
35+ parent ::__construct ($ component , $ lng );
36+ $ this ->lng ->loadLanguageModule ('logging ' );
37+ if (!$ registration ) {
38+ $ this ->additionalConstruct ();
39+ }
40+ }
41+
42+ private function additionalConstruct ()
3243 {
3344 global $ DIC ;
34-
35- $ this ->lng = $ DIC ->language ();
36- $ this ->lng ->loadLanguageModule ("logging " );
3745 $ this ->settings = new ilSetting ('log ' );
3846 $ this ->error_settings = ilLoggingErrorSettings::getInstance ();
3947 }
Original file line number Diff line number Diff line change 99 <parent id =" adm" max =" 1" >adm</parent >
1010 </object >
1111 </objects >
12- <crons >
13- <cron id =" log_error_file_cleanup" class =" ilLoggerCronCleanErrorFiles" path =" Services/Logging/classes/error/" />
14- </crons >
1512 <logging id =" log" />
1613</service >
You can’t perform that action at this time.
0 commit comments