Skip to content

Commit 080b5df

Browse files
committed
Component/SystemCheck: contribute cron jobs
1 parent 05ab957 commit 080b5df

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

components/ILIAS/SystemCheck/SystemCheck.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ public function init(
3232
array | \ArrayAccess &$pull,
3333
array | \ArrayAccess &$internal,
3434
): void {
35-
// ...
35+
$contribute[\ILIAS\Cron\CronJob::class] = static fn() =>
36+
new \ilSCCronTrash(
37+
self::class,
38+
$use[\ILIAS\Language\Language::class],
39+
$use[\ILIAS\Logging\LoggerFactory::class]
40+
);
3641
}
3742
}

components/ILIAS/SystemCheck/classes/class.ilSCCronTrash.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/**
64
* This file is part of ILIAS, a powerful learning management system
75
* published by ILIAS open source e-Learning e.V.
@@ -18,6 +16,8 @@
1816
*
1917
*********************************************************************/
2018

19+
declare(strict_types=1);
20+
2121
use ILIAS\Cron\Schedule\CronJobScheduleType;
2222

2323
/**
@@ -26,18 +26,16 @@
2626
*/
2727
class ilSCCronTrash extends ilCronJob
2828
{
29-
protected ilLanguage $lng;
3029
protected ilTree $tree;
3130
protected ilObjectDefinition $objDefinition;
3231

33-
public function __construct()
32+
public function init(): void
3433
{
35-
global $DIC;
34+
$this->lng->loadLanguageModule('sysc');
3635

37-
$this->lng = $DIC->language();
36+
global $DIC;
3837
$this->tree = $DIC->repositoryTree();
3938
$this->objDefinition = $DIC['objDefinition'];
40-
$this->lng->loadLanguageModule('sysc');
4139
}
4240

4341
public function getId(): string

components/ILIAS/SystemCheck/service.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,5 @@
77
<parent id="adm" max="1">adm</parent>
88
</object>
99
</objects>
10-
<crons>
11-
<cron id="sysc_trash" class="ilSCCronTrash" />
12-
</crons>
1310
<logging />
1411
</service>

0 commit comments

Comments
 (0)