19declare(strict_types=1);
43 return hash(
"sha256", self::class . $this->plugin_name);
51 return "Install plugin $this->plugin_name.";
69 new \ilIniFilesPopulatedObjective(),
70 new \ilDatabaseUpdatedObjective(),
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->isInstalled()) {
93 throw new \RuntimeException(
94 "Plugin $this->plugin_name is already installed."
98 $ORIG_DIC = $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->isInstalled();
123 $db = $environment->getResource(
Setup\Environment::RESOURCE_DATABASE);
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"][
"ilClientIniFile"] = $client_ini;
142 public static function getRootLogger():
ilLogger
146 public static function getLogger(
string $a_component_id):
ilLogger
154 $GLOBALS[
"DIC"][
"lng"]->lang_user =
'en';
155 $GLOBALS[
"DIC"][
"ilPluginAdmin"] = $plugin_admin;
159 $GLOBALS[
"DIC"][
"ilAppEventHandler"] =
null;
161 $GLOBALS[
"DIC"][
"component.repository"] = $component_repository;
162 $GLOBALS[
"DIC"][
"component.factory"] = $component_factory;
164 public array $prefs = [];
168 $this->prefs[
"language"] =
"en";
177 if (!defined(
'DEBUG')) {
178 define(
'DEBUG',
false);
181 if (!defined(
'SYSTEM_ROLE_ID')) {
182 define(
'SYSTEM_ROLE_ID',
'2');
185 if (!defined(
"ILIAS_ABSOLUTE_PATH")) {
186 define(
"ILIAS_ABSOLUTE_PATH", dirname(__FILE__, 5));
189 if (!defined(
"CLIENT_ID")) {
190 define(
'CLIENT_ID', $client_ini->readVariable(
'client',
'name'));
193 if (!defined(
"ILIAS_WEB_DIR")) {
194 define(
'ILIAS_WEB_DIR',
"public/data/");
Customizing of pimple-DIC for ILIAS.
Read the client id of the installation from the data directory.
isApplicable(Setup\Environment $environment)
@inheritDoc
getPreconditions(Setup\Environment $environment)
initEnvironment(Setup\Environment $environment, \ilComponentRepository $component_repository, \ilComponentFactory $component_factory)
__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
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...