Skip to content

Phase 14c-5: editor install module on iManager 2.0#28

Merged
bigin merged 1 commit into
imanager-2.0from
phase-14c5-install
May 3, 2026
Merged

Phase 14c-5: editor install module on iManager 2.0#28
bigin merged 1 commit into
imanager-2.0from
phase-14c5-install

Conversation

@bigin
Copy link
Copy Markdown
Owner

@bigin bigin commented May 3, 2026

The /editor/install module manager is back online — discovers site/modules//.php candidates, lists them with their install/uninstall state, and rewrites data/settings/custom.scriptor- config.php with rolling backups in data/backups/configs/.

Compared to the legacy 618-line implementation this port:

  • drops the brick/varexporter dependency in favour of PHP's built-in var_export() (legacy code only ever emitted plain config arrays, no closures);
  • skips the install/uninstall lifecycle callbacks on loaded modules (the legacy Module::install/uninstall hooks); the new module interface lands post-Phase-17;
  • skips the hook-mapping bridge — Plan §14e brings the proper PSR-14 dispatcher; until then we don't touch config['hooks'].

The legacy moduleInfo() static contract is preserved: every module class under site/modules//.php is expected to expose public static function moduleInfo(): array. Modules without it are skipped silently.

EditorRouter routes /editor/install* to InstallModule and now has no remaining placeholder slugs — 14c is functionally complete with this PR. Dashboard text simplified accordingly.

Manual smoke (PHP built-in server, throwaway site/modules/Demo):
GET /editor/install 200, Demo (1.0.0) listed
GET /editor/install/Demo?action=install 302; custom.scriptor-config.php
contains modules.Demo
GET /editor/install 200, Demo now "active"
GET /editor/install/Demo?action=uninstall 302; modules.Demo gone,
1 backup file created
GET /editor/install/Demo?action=install 302 (no CSRF token)
config unchanged → reject ok
GET /editor/install (anonymous) 302 → /editor/auth/

The /editor/install module manager is back online — discovers
site/modules/<Name>/<Name>.php candidates, lists them with their
install/uninstall state, and rewrites data/settings/custom.scriptor-
config.php with rolling backups in data/backups/configs/.

Compared to the legacy 618-line implementation this port:
  - drops the brick/varexporter dependency in favour of PHP's
    built-in var_export() (legacy code only ever emitted plain
    config arrays, no closures);
  - skips the install/uninstall lifecycle callbacks on loaded
    modules (the legacy Module::install/uninstall hooks); the new
    module interface lands post-Phase-17;
  - skips the hook-mapping bridge — Plan §14e brings the proper
    PSR-14 dispatcher; until then we don't touch config['hooks'].

The legacy moduleInfo() static contract is preserved: every module
class under site/modules/<Name>/<Name>.php is expected to expose
`public static function moduleInfo(): array`. Modules without it
are skipped silently.

EditorRouter routes /editor/install* to InstallModule and now has
no remaining placeholder slugs — 14c is functionally complete with
this PR. Dashboard text simplified accordingly.

Manual smoke (PHP built-in server, throwaway site/modules/Demo):
  GET  /editor/install                       200, Demo (1.0.0) listed
  GET  /editor/install/Demo?action=install   302; custom.scriptor-config.php
                                                  contains modules.Demo
  GET  /editor/install                       200, Demo now "active"
  GET  /editor/install/Demo?action=uninstall 302; modules.Demo gone,
                                                  1 backup file created
  GET  /editor/install/Demo?action=install   302 (no CSRF token)
                                                  config unchanged → reject ok
  GET  /editor/install (anonymous)           302 → /editor/auth/
@bigin bigin merged commit 63a69dc into imanager-2.0 May 3, 2026
@bigin bigin deleted the phase-14c5-install branch May 15, 2026 05:24
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.

1 participant