19declare(strict_types=1);
39 return hash(
"sha256", self::class . $this->plugin_name);
47 return "Activate plugin $this->plugin_name.";
64 new \ilIniFilesLoadedObjective(),
65 new \ilDatabaseInitializedObjective(),
66 new \ilComponentPluginAdminInitObjective(),
67 new \ilComponentRepositoryExistsObjective(),
68 new \ilComponentFactoryExistsObjective()
77 $component_repository = $environment->
getResource(
Setup\Environment::RESOURCE_COMPONENT_REPOSITORY);
78 $component_factory = $environment->getResource(
Setup\Environment::RESOURCE_COMPONENT_FACTORY);
79 $info = $component_repository->getPluginByName($this->plugin_name);
81 if (!
$info->supportsCLISetup()) {
82 throw new \RuntimeException(
83 "Plugin $this->plugin_name does not support command line setup."
87 if (!
$info->isActivationPossible()) {
88 throw new \RuntimeException(
89 "Plugin $this->plugin_name can not be activated."
93 $ORIG_DIC = $this->
initEnvironment($environment, $component_repository, $component_factory);
106 $component_repository = $environment->getResource(
Setup\Environment::RESOURCE_COMPONENT_REPOSITORY);
107 $plugin = $component_repository->getPluginByName($this->plugin_name);
109 return $plugin->isActivationPossible($environment);
117 $db = $environment->getResource(
Setup\Environment::RESOURCE_DATABASE);
118 $plugin_admin = $environment->getResource(
Setup\Environment::RESOURCE_PLUGIN_ADMIN);
119 $ini = $environment->getResource(
Setup\Environment::RESOURCE_ILIAS_INI);
120 $client_ini = $environment->getResource(
Setup\Environment::RESOURCE_CLIENT_INI);
128 $GLOBALS[
"DIC"][
"component.repository"] = $component_repository;
129 $GLOBALS[
"DIC"][
"component.factory"] = $component_factory;
132 $GLOBALS[
"DIC"][
"ilClientIniFile"] = $client_ini;
138 public static function getRootLogger():
ilLogger
142 public static function getLogger(
string $a_component_id):
ilLogger
149 $GLOBALS[
"DIC"][
"ilPluginAdmin"] = $plugin_admin;
158 $GLOBALS[
"DIC"][
"ilAppEventHandler"] =
null;
161 public array $prefs = [];
165 $this->prefs[
"language"] =
"en";
169 if (!defined(
'SYSTEM_ROLE_ID')) {
170 define(
'SYSTEM_ROLE_ID',
'2');
173 if (!defined(
"ILIAS_ABSOLUTE_PATH")) {
174 define(
"ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 5));
177 if (!defined(
"CLIENT_ID")) {
178 define(
'CLIENT_ID', $client_ini->readVariable(
'client',
'name'));
181 if (!defined(
"ILIAS_WEB_DIR")) {
182 define(
'ILIAS_WEB_DIR',
"public/data/");
Customizing of pimple-DIC for ILIAS.
initEnvironment(Setup\Environment $environment, \ilComponentRepository $component_repository, \ilComponentFactory $component_factory)
isApplicable(Setup\Environment $environment)
@inheritDoc
__construct(string $plugin_name)
achieve(Setup\Environment $environment)
getPreconditions(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
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...