Skip to content

Phase 14b-1: Frontend skeleton on iManager 2.0 container#19

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

Phase 14b-1: Frontend skeleton on iManager 2.0 container#19
bigin merged 1 commit into
imanager-2.0from
phase-14b1-skeleton

Conversation

@bigin
Copy link
Copy Markdown
Owner

@bigin bigin commented May 3, 2026

Summary

Public Scriptor site renders from the migrated SQLite DB through a brand-new,
container-driven render path. Default-theme files (default.php, template.php,
_head/_header/_footer.php) keep working as adapter templates — only one
$site->version substitution in _footer.php.

New PSR-4 namespace Scriptor\Boot\Frontend\:

  • Page — readonly DTO around Imanager\Domain\Item
  • PageRepository — wrapper over CategoryRepository + ItemRepository, built
    on the iManager Query AST
  • Sanitizer — facade over Imanager\Validation\Sanitizer adding the
    legacy-only templateName() and pageName() helpers themes still call
  • Site — minimal renderer: resolves slug from REQUEST_URI, exposes the
    legacy $site surface (siteUrl, themeUrl, config, version, page, sanitizer,
    render(), cache(), throw404(), getTCP()-stub). The render() switch returns ''
    for theme-overridable hooks (hero, mainNavItems, footerNav, …) so the
    default render path doesn't crash before BasicTheme reattaches in 14b-2.

boot.php loads vendor/autoload + container + the legacy scriptor-config.php
(with IS_IM/IM_DATAPATH defines so the legacy file header doesn't die()).
index.php constructs Frontend\Site directly. The basic-theme _ext.php
(BasicRouter / SuperCache / BasicTheme) is intentionally NOT loaded — comes
back in 14b-2.

Test plan

  • GET / → 200, 5.3 KB, <h1>Scriptor's Demo Page</h1>, markdown content
  • GET /scriptors-demo-page → 200, identical (home slug)
  • GET /this-does-not-exist → 404, sane fallback
  • Browser smoke against ServBay

Public site renders from the migrated SQLite DB through a brand-new,
container-driven render path. Default-theme files (default.php,
template.php, _head/_header/_footer.php) keep working as adapter
templates — only one $site->version substitution in _footer.php.

New PSR-4 namespace `Scriptor\Boot\Frontend\`:
  - Page         — readonly DTO around `Imanager\Domain\Item`; surfaces
                   slug/template/parent/content/menu_title/images plus
                   any other field via __get against the FieldValueBag.
  - PageRepository
                 — wrapper over CategoryRepository + ItemRepository for
                   the Pages category; find/findBySlug/findHome/
                   findByParent/findActiveByParent built on the iManager
                   Query AST.
  - Sanitizer    — facade over `Imanager\Validation\Sanitizer` adding
                   the legacy-only `templateName()` and `pageName()`
                   helpers themes still call.
  - Site         — minimal renderer: resolves the requested slug from
                   `$_SERVER['REQUEST_URI']`, exposes the legacy `$site`
                   surface (siteUrl, themeUrl, config, version, page,
                   sanitizer, render(), cache(), throw404(), getTCP()
                   stub with sane defaults). The render() switch returns
                   '' for theme-overridable hooks (hero, mainNavItems,
                   footerNav, …) so the default render path doesn't
                   crash before BasicTheme reattaches in 14b-2.

boot.php now loads vendor/autoload + container + the legacy
scriptor-config.php (with IS_IM/IM_DATAPATH defines so the legacy file
header doesn't die()). The 1.x `imanager/` library and
`editor/core/scriptor.php` stay disabled — same Imanager\ namespace
clash as 14a.

index.php constructs Frontend\Site directly and includes the theme
template. The basic-theme `_ext.php` (BasicRouter / SuperCache /
BasicTheme) is intentionally NOT loaded here — comes back in 14b-2.

Manual smoke (PHP built-in server):
  GET /                       → 200, 5.3 KB, <h1>Scriptor's Demo Page</h1>
  GET /scriptors-demo-page    → 200, identical (home slug)
  GET /this-does-not-exist    → 404, sane fallback

Markdown content rendered via Sanitizer::markdown() (Parsedown +
HTMLPurifier when enabled).
@bigin bigin merged commit 6afee71 into imanager-2.0 May 3, 2026
@bigin bigin deleted the phase-14b1-skeleton branch May 15, 2026 05:23
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