examples/003-MiniWebApp/
public/index.php # front controller (only web-exposed PHP)
src/Router.php # dispatch table (functions or array routes)
templates/layout.php # shared HTML shell
templates/home.php
templates/hello.php
templates/contact.php
assets/style.css # static (served by DevServer **#150** ✅)
Problem
#67 defines the reference app. This issue specifies the routing architecture so implementers know the target before writing
003-MiniWebApp.Goal
Document and implement a minimal front-controller pattern:
Routes (minimum)
//hello?name=/contact/api/statusImplementation hints
public/index.phpreads$_SERVER['REQUEST_URI']orPATH_INFO(Web: PATH_INFO and front-controller routing ($_SERVER) #121 ✅, integration Testing: ServeTest PATH_INFO front-controller dispatch #276) — avoid hard-codedexample.php(Web: DevServer default document (index.php) instead of hard-coded example.php #254).matchon method + path prefix (use?:when Language: Ternary operator (?:) in compiler pipeline #114 lands;switchwhen JIT: Implement switch/case opcodes (TYPE_CASE) — VM works, JIT stubbed #96/Compiler: Register JIT-stubbed switch in UnsupportedRegistry (lint parity) #288 ready).requirelayout withincludepartials (Language: include/require in JIT and AOT (multi-file applications) #54); variables via locals or Stdlib: extract() and compact() for PHP template includes #275extract()when available.phpc lint --all(DevEx: phpc lint --all for project trees (MiniWebApp blocker report) #286) before JIT/AOT; track blockers in Reference: MiniWebApp lint-first skeleton (examples/003-MiniWebApp) #246.phpc serve, optional JIT (Web: JIT/AOT mode for bin/serve.php (compile per script on first request) #207), AOTphpc build+phpc serve --aot(DevEx: phpc serve --aot runs precompiled CGI binary per project #213 ✅), production CGI (Web: CGI/1.1 request driver (stdin/stdout, env, Status line) #50).Acceptance criteria
examples/003-MiniWebApp/exists with structure abovephpc servecurl recipes in READMEmake test-dockergreen (serve tests when loopback allowed)Verification (local / Docker only)
Dependencies
__DIR__htmlspecialcharsSCRIPT_FILENAME, Web: $_SERVER['SERVER_PROTOCOL'] from HTTP request line #306SERVER_PROTOCOLLinks
examples/001-SimpleWeb/,lib/Web/Superglobals.php(derivePathInfo)