20declare(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);
94 $plugin = $component_factory->getPlugin($info->getId());
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;
140 public function info(
string $a_message):
void
143 public function warning(
string $a_message):
void
146 public function error(
string $a_message):
void
149 public function debug(
string $a_message, array $a_context = []):
void
160 public static function getRootLogger():
ilLogger
164 public static function getLogger(
string $a_component_id):
ilLogger
171 $GLOBALS[
"DIC"][
"ilPluginAdmin"] = $plugin_admin;
180 $GLOBALS[
"DIC"][
"ilAppEventHandler"] =
null;
183 public array $prefs = [];
187 $this->prefs[
"language"] =
"en";
191 if (!defined(
'DEBUG')) {
192 define(
'DEBUG',
false);
195 if (!defined(
'SYSTEM_ROLE_ID')) {
196 define(
'SYSTEM_ROLE_ID',
'2');
199 if (!defined(
"ILIAS_ABSOLUTE_PATH")) {
200 define(
"ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 5));
203 if (!defined(
"CLIENT_ID")) {
204 define(
'CLIENT_ID', $client_ini->readVariable(
'client',
'name'));
207 if (!defined(
"ILIAS_WEB_DIR")) {
208 define(
'ILIAS_WEB_DIR', dirname(__DIR__, 4) .
"/data/");
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
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
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...
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...