Skip to content

refactor: clean up version handling#6532

Merged
gharlan merged 2 commits into
6.xfrom
chore/cleanup-version-handling
May 31, 2026
Merged

refactor: clean up version handling#6532
gharlan merged 2 commits into
6.xfrom
chore/cleanup-version-handling

Conversation

@gharlan
Copy link
Copy Markdown
Member

@gharlan gharlan commented May 31, 2026

Was

Räumt das Version-Handling in Core und Addon auf.

Der erste Commit wirft die write-only version-Core-Config raus (ein 5.x-Relikt der Versions-Diff-Update-Erkennung; 6.x updatet über idempotente install.php / console migrate).

Aufbauend darauf liest der zweite Commit die Version nur noch aus Composer:

  • Die version-Property wurde ohnehin nur von getVersion() selbst als In-Memory-Cache gesetzt — niemand sonst schreibt sie mehr. Composers InstalledVersions cached installed.php bereits statisch, die Memoization sparte also nichts.
  • getVersion() liest jetzt direkt aus InstalledVersions.
  • Entfernt den toten version-Validierungs-case in Core::setProperty(), den version-Eintrag in der getProperty()-Type-Map und den obsoleten @psalm-taint-escape file (der Composer-Wert ist keine Taint-Quelle — per composer taint verifiziert).
  • Für Addons ist Composer damit Single Source of Truth: ein verirrtes version: in der package.yml kann die Composer-Version nicht mehr überschreiben.

Alle Checks grün (PHPUnit, PHPStan, Psalm, Taint, CS).

gharlan added 2 commits May 31, 2026 11:17
The 'version' key was written to rex_config at the end of setup but never
read anywhere. It is a leftover from the 5.x version-diff update detection;
6.x runs updates via idempotent install.php (console migrate) instead.
The 'version' property was only ever set by getVersion() itself as an
in-memory cache; nothing else writes it anymore (the persisted core
config was just dropped). Composer's InstalledVersions already caches
installed.php statically, so the memoization saved nothing.

Read directly from InstalledVersions and drop the now-dead 'version'
property validation, its getProperty type-map entry and the obsolete
taint-escape (the Composer-provided value is not a taint source). For
addons this also makes Composer the single source of truth, so a stray
'version' in package.yml can no longer override it.
@gharlan gharlan added this to the REDAXO 6.0 milestone May 31, 2026
@gharlan gharlan merged commit ce32e0b into 6.x May 31, 2026
16 checks passed
@gharlan gharlan deleted the chore/cleanup-version-handling branch May 31, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant