Skip to content

refactor(upgrade): migrate upgrade framework to namespaced classes with DI#10

Merged
mambax7 merged 13 commits intoXOOPS:masterfrom
mambax7:feature/upgrade_framework_modernization
Apr 12, 2026
Merged

refactor(upgrade): migrate upgrade framework to namespaced classes with DI#10
mambax7 merged 13 commits intoXOOPS:masterfrom
mambax7:feature/upgrade_framework_modernization

Conversation

@mambax7
Copy link
Copy Markdown
Contributor

@mambax7 mambax7 commented Apr 11, 2026

Complete the upgrade framework modernization that was partially started
with the scanner classes. Migrates the three core classes from legacy
flat files to PSR-4 namespaced structure, adds a proper autoloader, and
updates every upd_*/index.php to use constructor dependency injection.

Framework changes:

  • class/abstract.php → class/Xoops/Upgrade/XoopsUpgrade.php
  • class/control.php → class/Xoops/Upgrade/UpgradeControl.php
  • class/patchstatus.php → class/Xoops/Upgrade/PatchStatus.php
  • class/autoload.php (new) PSR-4 autoloader for Xoops\Upgrade
  • class/fatal_error_handler.php (new) centralized fatal error capture

Every upd_*/index.php file updated to:

  • use Xoops\Upgrade\XoopsUpgrade; use Xoops\Upgrade\UpgradeControl;
  • public function __construct(XoopsMySQLDatabase $db, UpgradeControl $control)
  • parent::__construct($db, $control, basename(DIR))

upd_2.5.11-to-2.7.0/index.php gains 6 new upgrade tasks:

  • widenconfid — config.conf_id + configoption.conf_id smallint → int
  • widenimagename — image.image_name varchar(30) → varchar(191)
  • cleanuplibraries — delete obsolete build artifacts from class/libraries/
  • deletetinymce5nested — delete duplicate tinymce5/tinymce5/ nested directory
  • deleteflashsanitizer — delete obsolete Flash text sanitizer plugin
  • cleancache — clear compiled templates and cache files

upgrade_tpl.php refactored to use a $viewModel array for cleaner
separation between the upgrade controller and its template rendering.

Tested end-to-end by running the upgrade wizard from a fresh XOOPS 2.5.11
install through to 2.7.0 RC1, including the System module update step
that seeds menus. All upgrade tasks completed successfully.

Summary by CodeRabbit

  • New Features

    • Template-driven upgrade UI, autoloading for upgrade components, centralized upgrade queue, multi-language support discovery, and a global fatal-error reporter.
  • Bug Fixes

    • Safer database interactions and result validation, hardened path/language includes, atomic license-file writes, improved login/error reporting, safer unserialization and file operations.
  • Refactor

    • Modernized upgrade framework with dependency injection, typed upgrade modules, clearer orchestration, safer file deletion and improved logging.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants