Skip to content

Commit

Permalink
Component: reset resolutions to fix #42480
Browse files Browse the repository at this point in the history
  • Loading branch information
klees committed Dec 19, 2024
1 parent bdd49f1 commit a3777ff
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 3 deletions.
5 changes: 4 additions & 1 deletion cli/build_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@
}

echo "Resolving Dependency using {$resolution_file}...\n";
$disambiguation = require_once($resolution_file);
$disambiguation = require($resolution_file);

foreach ($component_info as $ci) {
$ci->resetResolutions();
}
$component_info = $resolver->resolveDependencies($disambiguation, ...$component_info);

echo "Writing bootstrap to artifacts/bootstrap_$name.php\n";
Expand Down
4 changes: 4 additions & 0 deletions components/ILIAS/Component/src/Dependencies/Define.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ public function getName(): string
{
return (string) $this->name;
}

public function resetResolutions(): void
{
}
}
5 changes: 5 additions & 0 deletions components/ILIAS/Component/src/Dependencies/In.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,9 @@ public function getResolvedBy(): array
{
return $this->resolved_by;
}

public function resetResolutions(): void
{
$this->resolved_by = [];
}
}
9 changes: 9 additions & 0 deletions components/ILIAS/Component/src/Dependencies/OfComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ public function getOutDependenciesOf(OutType $type): \Iterator
}
}

public function resetResolutions(): void
{
foreach ($this->dependencies as $d) {
foreach ($d as $o) {
$o->resetResolutions();
}
}
}

// ArrayAccess

public function offsetExists($dependency_description): bool
Expand Down
5 changes: 5 additions & 0 deletions components/ILIAS/Component/src/Dependencies/Out.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,9 @@ public function addResolves(In $in): void
{
$this->resolves[] = $in;
}

public function resetResolutions(): void
{
$this->resolves = [];
}
}
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
},
"scripts": {
"post-autoload-dump": [
"@php cli/build_bootstrap.php components/ILIAS/Setup/resources/dependency_resolution.php setup",
"@php cli/build_bootstrap.php components/ILIAS/Init/resources/dependency_resolution.php default",
"@php cli/build_bootstrap.php components/ILIAS/Setup/resources/dependency_resolution.php setup components/ILIAS/Init/resources/dependency_resolution.php default",
"@php cli/setup.php build --yes"
],
"pre-install-cmd": [
Expand Down

0 comments on commit a3777ff

Please sign in to comment.