19declare(strict_types=1);
21require_once(__DIR__ .
"/../vendor/composer/vendor/autoload.php");
26This builds the bootstrap of
ILIAS by reading all
components and resolving the
27dependencies. If you want
to use
custom directives
to resolve ambiguous dependencies,
28call
this script with a parameter pointing a file defining the resolution.
33if (count($argv) < 3 || count($argv) % 2 != 1) {
34 die(
"php cli/build_bootstrap.php \$dependency_resolution \$name [\$another_dependency_resolution \$another_name ...]\n");
47$vendors = new \DirectoryIterator(realpath(__DIR__ .
"/../components"));
48echo
"Reading Vendors from \"./components\"...\n";
49foreach ($vendors as $vendor) {
50 if (str_starts_with($vendor->getFilename(),
".")) {
53 if (!$vendor->isDir()) {
54 echo
" unexpected non-directory: {$vendor->getPathName()}\n";
57 echo
" Reading Components from Vendor \"{$vendor->getFilename()}\"...\n";
60 if (str_starts_with($component->getFilename(),
".")) {
63 if (!$vendor->isDir()) {
64 echo
" unexpected non-directory: {$component->getPathName()}\n";
67 if (!file_exists($component->getPathName() .
"/" . $component->getFileName() .
".php")) {
68 echo
" expected \"Component.php\" in {$component->getPathName()}\n";
71 require_once($component->getPathName() .
"/" . $component->getFileName() .
".php");
72 $component_name = $vendor->getFilename() .
"\\" . $component->getFileName();
73 echo
" Reading Component \"$component_name\"...\n";
74 $component_info[] = $reader->read(
new $component_name());
85while (count($argv) > 0) {
86 $resolution_file = array_shift($argv);
87 $name = array_shift($argv);
89 if (!file_exists($resolution_file)) {
90 die(
"Cannot find resolution file at {$resolution_file}.\n");
93 echo
"Resolving Dependency using {$resolution_file}...\n";
94 $disambiguation = require($resolution_file);
96 foreach ($component_info as $ci) {
97 $ci->resetResolutions();
99 $component_info =
$resolver->resolveDependencies($disambiguation, ...$component_info);
101 echo
"Writing bootstrap to artifacts/bootstrap_$name.php\n";
104 if (!is_dir(__DIR__ .
"/../artifacts")) {
105 mkdir(__DIR__ .
"/../artifacts", 0755,
true);
107 file_put_contents(__DIR__ .
"/../artifacts/bootstrap_$name.php",
$bootstrap);
foreach($components as $component) $resolver
This takes a (hopefully resolved...) dependency tree and renders it in PHP to be used for initialisat...
if(count($argv) !==3) $bootstrap
to(\GdImage $image, ?int $quality=null)
Currently this is the only way to make a FileStream from a GD image resource.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
Class ilChatroomConfigFileHandler \ILIAS\Chatroom\classes.