forked from ILIAS-eLearning/ILIAS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup: begin impl in new component framework
- Loading branch information
Showing
5 changed files
with
124 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,162 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* Copyright (c) 2019 Richard Klees <[email protected]> Extended GPL, see docs/LICENSE */ | ||
|
||
$executed_in_directory = getcwd(); | ||
chdir(__DIR__ . "/.."); | ||
|
||
require_once(__DIR__ . "/../vendor/composer/vendor/autoload.php"); | ||
|
||
require_once(__DIR__ . "/../ilias_version.php"); | ||
|
||
// according to ./Services/Feeds/classes/class.ilExternalFeed.php: | ||
if (!defined("MAGPIE_DIR")) { | ||
define("MAGPIE_DIR", "./components/ILIAS/Feeds/magpierss/"); | ||
} | ||
|
||
require_once(__DIR__ . "/../components/ILIAS/setup_/classes/class.ilSetupObjective.php"); | ||
require_once(__DIR__ . "/../components/ILIAS/setup_/classes/class.ilSetupAgent.php"); | ||
require_once(__DIR__ . "/../components/ILIAS/setup_/classes/class.ilSetupConfig.php"); | ||
require_once(__DIR__ . "/../components/ILIAS/setup_/classes/class.ilMakeInstallationAccessibleObjective.php"); | ||
require_once(__DIR__ . "/../components/ILIAS/setup_/classes/class.ilUseRootConfirmed.php"); | ||
require_once(__DIR__ . "/../components/ILIAS/setup_/classes/class.ilOwnRiskConfirmedObjective.php"); | ||
require_once(__DIR__ . "/../components/ILIAS/setup_/classes/class.ilOverwritesExistingInstallationConfirmed.php"); | ||
require_once(__DIR__ . "/../components/ILIAS/setup_/classes/class.ilIniFilesPopulatedObjective.php"); | ||
require_once(__DIR__ . "/../components/ILIAS/setup_/classes/class.ilIniFilesLoadedObjective.php"); | ||
require_once(__DIR__ . "/../components/ILIAS/setup_/classes/class.ilNICKeyRegisteredObjective.php"); | ||
require_once(__DIR__ . "/../components/ILIAS/setup_/classes/class.ilNICKeyStoredObjective.php"); | ||
require_once(__DIR__ . "/../components/ILIAS/setup_/classes/class.ilSetupConfigStoredObjective.php"); | ||
require_once(__DIR__ . "/../components/ILIAS/setup_/classes/class.ilSetupMetricsCollectedObjective.php"); | ||
|
||
use ILIAS\UI\Component\Input\Field\Factory as FieldFactory; | ||
use ILIAS\UI\Component\Input\Field\File; | ||
use ILIAS\UI\Component\Input\Field\Tag; | ||
use ILIAS\UI\Component\Input\Field\UploadHandler; | ||
|
||
$c = build_container_for_setup($executed_in_directory); | ||
$app = $c["app"]; | ||
$app->run(); | ||
|
||
// ATTENTION: This is a hack to get around the usage of the echo/exit pattern in | ||
// the setup for the command line version of the setup. Do not use this. | ||
function setup_exit($message) | ||
{ | ||
if (!defined("ILIAS_SETUP_IGNORE_DB_UPDATE_STEP_MESSAGES") || !ILIAS_SETUP_IGNORE_DB_UPDATE_STEP_MESSAGES) { | ||
throw new \ILIAS\Setup\UnachievableException($message); | ||
} | ||
} | ||
|
||
function build_container_for_setup(string $executed_in_directory): \Pimple\Container | ||
{ | ||
$c = new \Pimple\Container(); | ||
|
||
$c["app"] = function ($c) { | ||
return new \ILIAS\Setup\CLI\App( | ||
$c["command.install"], | ||
$c["command.update"], | ||
$c["command.build-artifacts"], | ||
$c["command.achieve"], | ||
$c["command.status"], | ||
$c["command.migrate"] | ||
); | ||
}; | ||
$c["command.install"] = function ($c) { | ||
return new \ILIAS\Setup\CLI\InstallCommand( | ||
$c["agent_finder"], | ||
$c["config_reader"], | ||
$c["common_preconditions"] | ||
); | ||
}; | ||
$c["command.update"] = function ($c) { | ||
return new \ILIAS\Setup\CLI\UpdateCommand( | ||
$c["agent_finder"], | ||
$c["config_reader"], | ||
$c["common_preconditions"] | ||
); | ||
}; | ||
$c["command.build-artifacts"] = function ($c) { | ||
return new \ILIAS\Setup\CLI\BuildArtifactsCommand( | ||
$c["agent_finder"] | ||
); | ||
}; | ||
$c["command.achieve"] = function ($c) { | ||
return new \ILIAS\Setup\CLI\AchieveCommand( | ||
$c["agent_finder"], | ||
$c["config_reader"], | ||
$c["common_preconditions"], | ||
$c["refinery"] | ||
); | ||
}; | ||
$c["command.status"] = function ($c) { | ||
return new \ILIAS\Setup\CLI\StatusCommand( | ||
$c["agent_finder"] | ||
); | ||
}; | ||
|
||
$c["command.migrate"] = function ($c) { | ||
return new \ILIAS\Setup\CLI\MigrateCommand( | ||
$c["agent_finder"], | ||
$c["common_preconditions"] | ||
); | ||
}; | ||
|
||
$c["common_preconditions"] = function ($c) { | ||
return [ | ||
new \ilOwnRiskConfirmedObjective(), | ||
new \ilUseRootConfirmed() | ||
]; | ||
}; | ||
|
||
$c["common_agent"] = function ($c) { | ||
return new \ilSetupAgent( | ||
$c["refinery"], | ||
$c["data_factory"] | ||
); | ||
}; | ||
|
||
$c["agent_finder"] = function ($c) { | ||
return new ILIAS\Setup\ImplementationOfAgentFinder( | ||
$c["refinery"], | ||
$c["data_factory"], | ||
$c["lng"], | ||
$c["interface_finder"], | ||
[ | ||
"common" => $c["common_agent"] | ||
] | ||
); | ||
}; | ||
|
||
$c["refinery"] = function ($c) { | ||
return new ILIAS\Refinery\Factory( | ||
$c["data_factory"], | ||
$c["lng"] | ||
); | ||
}; | ||
|
||
$c["data_factory"] = function ($c) { | ||
return new ILIAS\Data\Factory(); | ||
}; | ||
|
||
$c["lng"] = function ($c) { | ||
return new \ilSetupLanguage("en"); | ||
}; | ||
|
||
$c["config_reader"] = function ($c) use ($executed_in_directory) { | ||
return new \ILIAS\Setup\CLI\ConfigReader( | ||
$c["json.parser"], | ||
$executed_in_directory | ||
); | ||
}; | ||
|
||
$c["interface_finder"] = function ($c) { | ||
return new \ILIAS\Setup\ImplementationOfInterfaceFinder(); | ||
}; | ||
|
||
$c["json.parser"] = function ($c) { | ||
return new \Seld\JsonLint\JsonParser(); | ||
}; | ||
|
||
return $c; | ||
} | ||
/** | ||
* This file is part of ILIAS, a powerful learning management system | ||
* published by ILIAS open source e-Learning e.V. | ||
* | ||
* ILIAS is licensed with the GPL-3.0, | ||
* see https://www.gnu.org/licenses/gpl-3.0.en.html | ||
* You should have received a copy of said license along with the | ||
* source code, too. | ||
* | ||
* If this is not the case or you just want to try ILIAS, you'll find | ||
* us at: | ||
* https://www.ilias.de | ||
* https://github.com/ILIAS-eLearning | ||
* | ||
*********************************************************************/ | ||
|
||
require_once(__DIR__ . "/../artifacts/bootstrap.php"); | ||
|
||
exit(entry_point("The ILIAS Setup")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters