Skip to content

Commit 403b628

Browse files
committed
Cron: make CronRegistry a proper service
1 parent ce5cac9 commit 403b628

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

components/ILIAS/Cron/Cron.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ public function init(
3434
): void {
3535
$contribute[\ILIAS\Setup\Agent::class] = static fn() =>
3636
new \ilCronJobSetupAgent(
37-
$seek[\ILIAS\Cron\CronJob::class]
37+
$use[\ILIAS\Cron\Registry::class]
3838
);
3939

4040
$define[] = Cron\Registry::class;
4141

42-
$provide[Cron\Registry::class] = static fn() =>
42+
$implement[Cron\Registry::class] = static fn() =>
4343
$internal[Cron\CronRegistry::class];
4444

4545
$internal[Cron\CronRegistry::class] = static fn() =>

components/ILIAS/Cron/classes/Setup/class.ilCronJobSetupAgent.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
class ilCronJobSetupAgent implements Setup\Agent
2525
{
2626
public function __construct(
27-
private array $cronjobs
27+
private \ILIAS\Cron\Registry $registry
2828
) {
2929
}
3030

@@ -41,14 +41,14 @@ public function getArrayToConfigTransformation(): Refinery\Transformation
4141
public function getInstallObjective(Setup\Config $config = null): Setup\Objective
4242
{
4343
return new ilCronjobsRegisteredObjective(
44-
$this->cronjobs
44+
$this->registry
4545
);
4646
}
4747

4848
public function getUpdateObjective(Setup\Config $config = null): Setup\Objective
4949
{
5050
return new ilCronjobsRegisteredObjective(
51-
$this->cronjobs
51+
$this->registry
5252
);
5353
}
5454

components/ILIAS/Cron/classes/Setup/class.ilCronJobsRegisteredObjective.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
class ilCronjobsRegisteredObjective implements Setup\Objective
2424
{
2525
public function __construct(
26-
private array $cronjobs
26+
private \ILIAS\Cron\Registry $registry
2727
) {
2828
}
2929

@@ -79,11 +79,10 @@ public function achieve(Setup\Environment $environment): Setup\Environment
7979
$mock_logger_factory = new class () implements \ILIAS\Logging\LoggerFactory {
8080
};
8181

82-
$registry = new ILIAS\Cron\CronRegistry($this->cronjobs);
8382
$language = new ilSetupLanguage('en');
8483

8584
$repo = new ilCronJobRepositoryImpl(
86-
$registry,
85+
$this->registry,
8786
$db,
8887
$settings_factory->settingsFor(),
8988
new ILIAS\components\Logging\NullLogger(),

components/ILIAS/Init/Init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function init(
120120
$pull[\ILIAS\UI\Implementation\Component\Progress\Factory::class],
121121
$pull[\ILIAS\UI\Implementation\Component\Progress\State\Factory::class],
122122
$pull[\ILIAS\UI\Implementation\Component\Progress\State\Bar\Factory::class],
123-
$pull[\ILIAS\Cron\Registry::class],
123+
$use[\ILIAS\Cron\Registry::class],
124124
);
125125
}
126126
}

0 commit comments

Comments
 (0)