Skip to content
Michael Beck edited this page Jun 8, 2026 · 3 revisions

rector-xoops — Tutorial & Rule Reference

A practical guide for XOOPS module developers: what xoops/rector-xoops does, how to run it on a module, what every rule means, and how to write your own rules.

  • Tool runtime: PHP 8.2+ · Rector 2.x. (The tool runs on 8.2+ even when modernising a XoopsCore25/PHP-7.4 module — Rector can target older output.)
  • Generated-code target: whatever you set with withPhpVersion() / withPhpSets() — usually php74 for XoopsCore25 modules and php82 for XoopsCore27 (XOOPS 2.7's floor); go higher only if you're deliberately raising the module's PHP floor. The XOOPS rules themselves are PHP-level-agnostic.
  • Scope: PHP only — it never touches .tpl files (Smarty templates are a separate XOOPS upgrade step).
  • Namespace: Xoops\Rector\ (PSR-4 → src/). Rules in Xoops\Rector\Rules\, sets via Xoops\Rector\Set\XoopsSetList.

Reading this as a wiki? Each numbered section below is self-contained and maps to one wiki page — the Contents list is the suggested Home / sidebar. (When you split it, this page becomes Home, and each ## N. heading becomes a page; the sub-headings under §3 and §4 are that page's in-page sections.)

Contents

  1. Why a XOOPS Rector package? — the AST-vs-regex rationale
  2. Install & run on a module — prerequisites · rector.php · the two sets · standalone sweep
  3. Rule reference — database · removed PHP · XOOPS API · MyTS & Smarty · risky set · planned Smarty 5
  4. Writing your own rule — anatomy · idempotency · configurable rules · traits · register · test
  5. Tips for XOOPS module developers
  6. What this package deliberately does NOT do
  7. Contributing

Clone this wiki locally