Skip to content

History of commits

4476 commits

feat(view): render the home page with Twig

The first page served by the Twig environment, with the public layout it needs. - ViewResponse: a controller returns the template and its data, the response normalizer renders it. The renderer arrives as a closure, so a controller that still returns a string does not assemble the environment. - themes/default/templates/layouts/{base,default}.twig and the components of the chrome, next to the existing .phtml ones. - The layout no longer reaches for di(), the container or the database: the facts it prints come from SiteRuntime and DebugPanelRuntime, built only when a template calls them. Ads and analytics are handed over as Markup. - The cookie banner is described by the consent module through the twig extension tag, so the theme only lays it out. - vite() takes an area instead of a path and resolves the entry point through the manifests of the theme chain. - themes/example moves to Twig and keeps documenting how an override is written. - app.* facts are reachable under their snake_case names; an attribute a guest does not carry is never read straight off the user model, since Eloquent answers __call() and Twig then invokes it as a method. - DEBUG and DEBUG_FOR_ALL are declared dynamic for PHPStan: their value belongs to the installation. Four baseline entries that rested on that are gone.
simba77 5 أغسطس 2026 21:04 Branch: 10.x 99cf83b

feat(view): add the Twig engine alongside Plates

Twig 3 is installed and wired, but nothing renders through it yet: no .twig template ships, so every page is still served by Plates. - Themes are described by an optional themes/<name>/theme.php: a parent to inherit from, the Vite entry points and free-form settings. A theme without a manifest inherits from the default one, so existing themes keep working. ThemeChainResolver expands a theme into the chain templates and assets are looked up along. - TemplatePathRegistry registers the namespaces by convention — @theme, @admin and one per installed module — so a module needs no Twig configuration at all. A module with unusual layout can add paths with the johncms.template_paths tag. - One environment serves the whole of HTTP, with autoescape on, and strict_variables and auto_reload following DEBUG. The compiled templates live in data/cache/twig/web, outside the document root. - Extensions: the app global (facts about the page, the user and the token resolved only if a template asks), the translation helpers, asset(), asset_exists(), vite(), avatar(), the value formatters, and plates(), which lets a Twig page pull in a partial that has not moved yet. - AssetResolver looks up a file along the theme chain and, unlike the Plates extension, does not take the page down when it is missing outside DEBUG. - New commands twig:lint (also part of the verification gate) and twig:compile. - i18n:scan now walks .twig templates too, through a second scanner working on the Twig AST — without it the strings of a migrated template would drop out of the .pot files.
simba77 5 أغسطس 2026 00:29 Branch: 10.x 38f7695

refactor(view): prepare the view layer for the Twig migration

Groundwork for running Twig alongside the current Plates engine. - The admin area is no longer detected by reading $_SERVER['REQUEST_URI'] in RenderEngineFactory and Assets: CurrentPage::isAdminArea() answers it off the RequestStack. Render resolves the theme through a resolver instead of holding a name, so the engine singleton no longer freezes the theme of the first request handled by the process. - Johncms\System\View\Theme renamed to Johncms\View\ColorScheme, with getCurrentScheme()/isDarkScheme(); it is the color scheme of the page, and the name is needed for the site theme. - New Johncms\View\RendererInterface with PlatesRenderer and DelegatingRenderer, which routes a template to its engine by the shape of its name (@ns/file.twig to Twig, ns::file to Plates). Registered as RendererInterface; the Twig renderer joins it once it exists.
simba77 5 أغسطس 2026 00:05 Branch: 10.x 5940daa

docs: record the mail and request changes

CHANGELOG: mail is sent by the scheduler only (USE_CRON removed) and the request is no longer a container service. The architecture guide no longer presents the position of the request argument as a rule, since the invoker resolves it by type.
simba77 30 يوليو 2026 23:39 Branch: 10.x c8fd836

refactor(mail): send the queue only from the scheduler

Kernel::terminate() no longer flushes the mail queue after the response, and the USE_CRON constant is removed with it: mail:send-pending is registered as a scheduled task and runs every minute, so the queue has one owner. The baseline entry for the always-true negation of USE_CRON is dropped too. Also merges the two consecutive isWebRuntime() blocks in handle() into one.
simba77 30 يوليو 2026 23:39 Branch: 10.x 00ed2fc

refactor(http): remove the Request service from the container

The synthetic Request entry, the base-class alias and both container->set() calls are gone: the request reaches a controller as an action argument and a long-lived service through the RequestStack. Request.php is excluded from the service loader, or the container would autowire it into an empty request built from the globals. The kernel no longer needs the Symfony-specific set(), so it is typed on the PSR container and the Symfony container alias is removed with it. RequestIsolationTest now pins that the stack is back to its boot entry after every cycle and that resolving Request::class throws.
simba77 30 يوليو 2026 23:25 Branch: 10.x edce3a2

refactor(http): give the layout page facts instead of the request

The layout needs one fact — whether the homepage is being served. CurrentPage answers it over the RequestStack (the is_homepage attribute, falling back to the path), and the template resolves that service the way it already resolves Theme.
simba77 30 يوليو 2026 23:24 Branch: 10.x 6c35f36