Skip to content

Commit 73f89db

Browse files
committed
Component/Tracking: contribute cron jobs
1 parent d02e204 commit 73f89db

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

components/ILIAS/Tracking/Tracking.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,12 @@ public function init(
3939
$contribute[SetupAgentInterface::class] = fn() => new SetupAgent($pull[Refinery::class]);
4040
$contribute[Component\Resource\PublicAsset::class] = fn() =>
4141
new Component\Resource\ComponentJS($this, "ilObjStat.js");
42+
43+
$contribute[\ILIAS\Cron\CronJob::class] = static fn() =>
44+
new \ilLPCronObjectStatistics(
45+
self::class,
46+
$use[Language\Language::class],
47+
$use[\ILIAS\Logging\LoggerFactory::class]
48+
);
4249
}
4350
}

components/ILIAS/Tracking/classes/class.ilLPCronObjectStatistics.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,17 @@
2828
class ilLPCronObjectStatistics extends ilCronJob
2929
{
3030
protected int $date = 0;
31-
32-
protected ilLanguage $lng;
3331
protected ilDBInterface $db;
3432
protected ilTree $tree;
3533
protected ilLogger $logger;
3634
protected ilCronManager $cron_manager;
3735

38-
public function __construct()
36+
public function init(): void
3937
{
40-
global $DIC;
38+
$this->lng->loadLanguageModule('trac');
39+
$this->logger = $this->logger_factory->getLogger('trac');
4140

42-
$this->logger = $DIC->logger()->trac();
43-
$this->lng = $DIC->language();
44-
$this->lng->loadLanguageModule("trac");
41+
global $DIC;
4542
$this->db = $DIC->database();
4643
$this->tree = $DIC->repositoryTree();
4744
$this->cron_manager = $DIC->cron()->manager();

components/ILIAS/Tracking/service.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,5 @@
1717
<event type="listen" id="components/ILIAS/Group" />
1818
<event type="listen" id="components/ILIAS/LearningSequence" />
1919
</events>
20-
<crons>
21-
<cron id="lp_object_statistics" class="ilLPCronObjectStatistics" />
22-
</crons>
2320
<logging />
2421
</service>

0 commit comments

Comments
 (0)