ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilRegistrationConfigUpdateObjective.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use ILIAS\Setup;
22
27{
28 public function getHash(): string
29 {
30 return hash("sha256", self::class);
31 }
32
33 public function getLabel(): string
34 {
35 return "Fix userid encoding in Registration settings";
36 }
37
38 public function isNotable(): bool
39 {
40 return true;
41 }
42
43 public function getPreconditions(Setup\Environment $environment): array
44 {
45 return [
46 new \ilIniFilesPopulatedObjective(),
47 new \ilSettingsFactoryExistsObjective()
48 ];
49 }
50
51 public function achieve(Setup\Environment $environment): Setup\Environment
52 {
53 $factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
55 $settings = $factory->settingsFor("common");
56 $approve_recipient_ids = [];
57 foreach (unserialize(
58 stripslashes($settings->get('approve_recipient', '')),
59 ['allowed_classes' => false]
60 ) ?: [] as $id) {
61 $approve_recipient_ids[] = (int) $id;
62 }
63 $settings->set('approve_recipient', addslashes(serialize($approve_recipient_ids)));
64 return $environment;
65 }
66
70 public function isApplicable(Setup\Environment $environment): bool
71 {
72 return true;
73 }
74}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
isApplicable(Setup\Environment $environment)
@inheritDoc
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...