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 init (): void
4034 {
35+ $ this ->logger = $ this ->logger_factory ->getRootLogger ();
36+
4137 /**
4238 * @var $DIC Container
4339 */
4440 global $ DIC ;
45- if ($ DIC ->offsetExists ('lng ' )) {
46- $ this ->language = $ DIC ['lng ' ];
47- }
4841 if ($ DIC ->offsetExists ('filesystem ' )) {
4942 $ this ->filesystem = $ DIC ->filesystem ()->temp ();
5043 }
51- if ($ DIC ->offsetExists ('ilLoggerFactory ' )) {
52- $ this ->logger = $ DIC ->logger ()->root ();
53- }
5444 }
5545
5646 private function initDependencies (): void
@@ -64,12 +54,12 @@ public function getId(): string
6454
6555 public function getTitle (): string
6656 {
67- return $ this ->language ->txt ('file_system_clean_temp_dir_cron ' );
57+ return $ this ->lng ->txt ('file_system_clean_temp_dir_cron ' );
6858 }
6959
7060 public function getDescription (): string
7161 {
72- return $ this ->language ->txt ("file_system_clean_temp_dir_cron_info " );
62+ return $ this ->lng ->txt ("file_system_clean_temp_dir_cron_info " );
7363 }
7464
7565 public function hasAutoActivation (): bool
@@ -128,7 +118,7 @@ public function run(): ilCronJobResult
128118 $ folders = $ this ->filesystem ->finder ()->in (["" ]);
129119 $ folders = $ folders ->directories ();
130120 $ folders = $ folders ->date ($ date );
131- $ folders = $ folders ->sort (fn (
121+ $ folders = $ folders ->sort (fn (
132122 Metadata $ a ,
133123 Metadata $ b
134124 ): int => strlen ($ a ->getPath ()) - strlen ($ b ->getPath ()));
0 commit comments