19 declare(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);
127 $GLOBALS[
"DIC"] =
new DI\Container();
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;
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/");
Readable part of repository interface to ilComponentDataDB.
initEnvironment(Setup\Environment $environment, \ilComponentRepository $component_repository, \ilComponentFactory $component_factory)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isApplicable(Setup\Environment $environment)
__construct(string $plugin_name)
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
getPreconditions(Setup\Environment $environment)
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.
achieve(Setup\Environment $environment)