Skip to content

Commit e491631

Browse files
committed
Component/LTIProvider: contribute cron jobs
1 parent 1495691 commit e491631

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

components/ILIAS/LTIProvider/LTIProvider.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,12 @@ public function init(
3939

4040
$contribute[Component\Resource\PublicAsset::class] = fn() =>
4141
new Component\Resource\Endpoint($this, "lti.php");
42+
43+
$contribute[\ILIAS\Cron\CronJob::class] = static fn() =>
44+
new \ilLTICronOutcomeService(
45+
self::class,
46+
$use[\ILIAS\Language\Language::class],
47+
$use[\ILIAS\Logging\LoggerFactory::class]
48+
);
4249
}
4350
}

components/ILIAS/LTIProvider/classes/class.ilLTICronOutcomeService.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@
2828
*/
2929
class ilLTICronOutcomeService extends ilCronJob
3030
{
31-
private ilLanguage $lng;
3231
private ilCronJobRepository $cronRepo;
3332

34-
public function __construct()
33+
public function init(): void
3534
{
35+
$this->lng->loadLanguageModule('lti');
36+
3637
global $DIC;
37-
$this->lng = $DIC->language();
38-
$this->lng->loadLanguageModule("lti");
3938
$this->cronRepo = $DIC->cron()->repository();
4039
}
4140

components/ILIAS/LTIProvider/service.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,5 @@
1313
<event type="listen" id="components/ILIAS/User" />
1414

1515
</events>
16-
<crons>
17-
<cron id="lti_outcome" class="ilLTICronOutcomeService" />
18-
</crons>
1916
<logging />
2017
</service>

0 commit comments

Comments
 (0)