2828class ilFileSystemCleanTempDirCron extends ilCronJob
2929{
3030 protected \ILIAS \Filesystem \Filesystem $ filesystem ;
31-
32- protected ilLanguage $ language ;
33-
3431 protected ilLogger $ logger ;
3532
36- /**
37- * @inheritDoc
38- */
39- public function __construct ()
33+ public function __construct (
34+ string $ component ,
35+ \ILIAS \Language \Language $ lng ,
36+ bool $ registration = false
37+ ) {
38+ parent ::__construct ($ component , $ lng );
39+ if (!$ registration ) {
40+ $ this ->additionalConstruct ();
41+ }
42+ }
43+
44+ private function additionalConstruct ()
4045 {
4146 /**
4247 * @var $DIC Container
4348 */
4449 global $ DIC ;
45- if ($ DIC ->offsetExists ('lng ' )) {
46- $ this ->language = $ DIC ['lng ' ];
47- }
4850 if ($ DIC ->offsetExists ('filesystem ' )) {
4951 $ this ->filesystem = $ DIC ->filesystem ()->temp ();
5052 }
@@ -64,12 +66,12 @@ public function getId(): string
6466
6567 public function getTitle (): string
6668 {
67- return $ this ->language ->txt ('file_system_clean_temp_dir_cron ' );
69+ return $ this ->lng ->txt ('file_system_clean_temp_dir_cron ' );
6870 }
6971
7072 public function getDescription (): string
7173 {
72- return $ this ->language ->txt ("file_system_clean_temp_dir_cron_info " );
74+ return $ this ->lng ->txt ("file_system_clean_temp_dir_cron_info " );
7375 }
7476
7577 public function hasAutoActivation (): bool
@@ -128,7 +130,7 @@ public function run(): ilCronJobResult
128130 $ folders = $ this ->filesystem ->finder ()->in (["" ]);
129131 $ folders = $ folders ->directories ();
130132 $ folders = $ folders ->date ($ date );
131- $ folders = $ folders ->sort (fn (
133+ $ folders = $ folders ->sort (fn (
132134 Metadata $ a ,
133135 Metadata $ b
134136 ): int => strlen ($ a ->getPath ()) - strlen ($ b ->getPath ()));
0 commit comments