19declare(strict_types=1);
31 $component_lookup = array_flip(
33 fn(
$c) =>
$c->getComponentName(),
68require_once(__DIR__ .
"/../vendor/composer/vendor/autoload.php");
73 \$implement =
new Pimple\Container();
74 \$contribute =
new Pimple\Container();
75 \$provide =
new Pimple\Container();
84 $use = $this->
renderUse($component_lookup, $component);
85 $seek = $this->
renderSeek($component_lookup, $component);
86 $pull = $this->
renderPull($component_lookup, $component);
92 \$use =
new Pimple\Container();{$use}
94 \$seek =
new Pimple\Container();{$seek}
95 \$provide[$me] =
new Pimple\Container();
96 \$pull =
new Pimple\Container();{$pull}
97 \$internal =
new Pimple\Container();
99 \$component_{$me}->init(\$null_dic, \$implement[$me], \$use, \$contribute[$me], \$seek, \$provide[$me], \$pull, \$internal);
108 $r = $in->getResolvedBy()[0];
109 $p = $r->aux[
"position"];
110 $o = $component_lookup[$r->getComponent()->getComponentName()];
111 $use .=
"\n" . <<<PHP
112 \$use[{$in->getName()}::class] = fn() => \$implement[{$o}][{$r->getName()}::class .
"_{$p}"];
122 $rs = $in->getResolvedBy();
125 foreach ($rs as $r) {
126 $p = $r->aux[
"position"];
127 $o = $component_lookup[$r->getComponent()->getComponentName()];
128 $u[] =
"\$contribute_{$o}";
130 \$contribute[$o][{$r->getName()}::class .
"_{$p}"],
133 $u = join(
", ", array_unique($u));
134 $seek .=
"\n" . <<<PHP
135 \$seek[{$in->getName()}::class] = fn() => [{
$a}
146 $r = $in->getResolvedBy()[0];
147 $o = $component_lookup[$r->getComponent()->getComponentName()];
148 $pull .=
"\n" . <<<PHP
149 \$pull[{$in->getName()}::class] = fn() => \$provide[{$o}][{$r->getName()}::class];
159 $p = $component_lookup[$component->getComponentName()];
165 \$entry_points = [{$entry_points}
168 if (!isset(\$entry_points[\$name])) {
169 throw new \\LogicException(
"Unknown entry point: \$name.");
172 return \$entry_points[\$name]()->enter();
181 foreach ($component->getOutDependenciesOf(OutType::CONTRIBUTE) as
$out) {
185 $p =
$out->aux[
"position"];
186 $n = str_replace(
"\"",
"\\\"",
$out->aux[
"entry_point_name"]);
187 $entry_points .=
"\n" . <<<PHP
188 "$n" => fn() => \$contribute[{$me}][ILIAS\Component\EntryPoint::class .
"_{$p}"],
192 return $entry_points;
An object that looks like a Dependency Injection Container but actually does nothing.
getInDependenciesOf(InType $type)
A wrapper around another DIC that superficially adds a _# and passes them to an underlying DIC.
This takes a (hopefully resolved...) dependency tree and renders it in PHP to be used for initialisat...
renderPull(array $component_lookup, OfComponent $component)
renderSeek(array $component_lookup, OfComponent $component)
renderEntryPoints(int $me, OfComponent $component)
renderUse(array $component_lookup, OfComponent $component)
render(OfComponent ... $components)
renderComponent(array $component_lookup, OfComponent $component)
renderEntryPointsSection(array $component_lookup, OfComponent ... $components)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
entry_point(string $name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...