19declare(strict_types=1);
43 return hash(
"sha256", self::class . $this->plugin_name);
51 return "Update plugin $this->plugin_name.";
69 new \ilIniFilesLoadedObjective(),
70 new \ilDatabaseInitializedObjective(),
71 new \ilComponentPluginAdminInitObjective(),
72 new \ilComponentRepositoryExistsObjective(),
73 new \ilComponentFactoryExistsObjective()
82 $component_repository = $environment->
getResource(
Setup\Environment::RESOURCE_COMPONENT_REPOSITORY);
83 $component_factory = $environment->getResource(
Setup\Environment::RESOURCE_COMPONENT_FACTORY);
84 $info = $component_repository->getPluginByName($this->plugin_name);
86 if (!
$info->supportsCLISetup()) {
87 throw new \RuntimeException(
88 "Plugin $this->plugin_name does not support command line setup."
92 if (!
$info->isUpdateRequired()) {
93 throw new \RuntimeException(
94 "Plugin $this->plugin_name is already updated."
98 [$ORIG_DIC, $ORIG_ilDB] = $this->
initEnvironment($environment, $component_repository, $component_factory);
112 $component_repository = $environment->getResource(
Setup\Environment::RESOURCE_COMPONENT_REPOSITORY);
113 $plugin = $component_repository->getPluginByName($this->plugin_name);
115 return $plugin->isUpdateRequired();
124 $plugin_admin = $environment->getResource(
Setup\Environment::RESOURCE_PLUGIN_ADMIN);
125 $ini = $environment->getResource(
Setup\Environment::RESOURCE_ILIAS_INI);
126 $client_ini = $environment->getResource(
Setup\Environment::RESOURCE_CLIENT_INI);
136 $GLOBALS[
"DIC"][
"component.repository"] = $component_repository;
137 $GLOBALS[
"DIC"][
"component.factory"] = $component_factory;
141 $GLOBALS[
"DIC"][
"ilClientIniFile"] = $client_ini;
148 public static function getRootLogger():
ilLogger
152 public static function getLogger(
string $a_component_id):
ilLogger
160 $GLOBALS[
"DIC"][
"ilPluginAdmin"] = $plugin_admin;
172 public function raise($a_component, $a_event, $a_parameter =
""):
void
189 public array $prefs = [];
193 $this->prefs[
"language"] =
"en";
197 if (!defined(
'DEBUG')) {
198 define(
'DEBUG',
false);
201 if (!defined(
'SYSTEM_ROLE_ID')) {
202 define(
'SYSTEM_ROLE_ID',
'2');
205 if (!defined(
"ILIAS_ABSOLUTE_PATH")) {
206 define(
"ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 6));
209 if (!defined(
"CLIENT_ID")) {
210 define(
'CLIENT_ID', $client_ini->readVariable(
'client',
'name'));
213 if (!defined(
"ILIAS_WEB_DIR")) {
214 define(
'ILIAS_WEB_DIR',
"public/data/");
222 return [$ORIG_DIC, $ORIG_ilDB];
Customizing of pimple-DIC for ILIAS.
Read the client id of the installation from the data directory.
initEnvironment(Setup\Environment $environment, \ilComponentRepository $component_repository, \ilComponentFactory $component_factory)
isApplicable(Setup\Environment $environment)
@inheritDoc
getPreconditions(Setup\Environment $environment)
__construct(string $plugin_name)
achieve(Setup\Environment $environment)
Component logger with individual log levels by component id.
parses the objects.xml it handles the xml-description of all ilias objects
Class ilRbacAdmin Core functions for role based access control.
class ilRbacReview Contains Review functions of core Rbac.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
An environment holds resources to be used in the setup process.
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.
Readable part of repository interface to ilComponentDataDB.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...