Problem
examples/003-MiniWebApp/templates/layout.php links /assets/style.css, but files live in examples/003-MiniWebApp/assets/ — outside the public/ docroot (phpc.json "public": "public").
DevServer::resolveDocrootFile() only maps URLs under public/, so GET /assets/style.css returns 404 during phpc serve even when HTML routes are green (#539). Production deploy (#180) needs the same asset tree beside the binary.
Goal
Manifest field (proposed "assets": "assets") or documented convention:
{
"entry": "public/index.php",
"public": "public",
"assets": "assets",
"binary": ".phpc/bin/app"
}
phpc serve and phpc serve --aot resolve /assets/* from the project assets/ directory (with path traversal guards matching DevServer::isSafeUrlPath).
Scope
Acceptance criteria
cd examples/003-MiniWebApp
../../phpc serve 127.0.0.1:8080 .
curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:8080/assets/style.css
# → 200
Docker:
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
bash -lc 'cd examples/003-MiniWebApp && ../../phpc serve 127.0.0.1:18080 . & sleep 1; curl -sf http://127.0.0.1:18080/assets/style.css | head -1'
No GitHub Actions required.
Dependencies
Links
- ROADMAP #78 Phase 3 Web runtime
- Layout:
examples/003-MiniWebApp/templates/layout.php
- Related: #277 static CSS in ServeAotTest (flat examples)
Problem
examples/003-MiniWebApp/templates/layout.phplinks/assets/style.css, but files live inexamples/003-MiniWebApp/assets/— outside thepublic/docroot (phpc.json"public": "public").DevServer::resolveDocrootFile()only maps URLs underpublic/, soGET /assets/style.cssreturns 404 duringphpc serveeven when HTML routes are green (#539). Production deploy (#180) needs the same asset tree beside the binary.Goal
Manifest field (proposed
"assets": "assets") or documented convention:{ "entry": "public/index.php", "public": "public", "assets": "assets", "binary": ".phpc/bin/app" }phpc serveandphpc serve --aotresolve/assets/*from the projectassets/directory (with path traversal guards matchingDevServer::isSafeUrlPath).Scope
lib/Web/ProjectManifest.php—resolveAssetsDir()+ validator inManifestValidatorlib/Web/DevServer.php— static file lookup: trypublic/first, thenassets/for non-.phppathsexamples/003-MiniWebApp/phpc.json— add"assets": "assets"(or move CSS underpublic/assets/)script/examples-web-smoke.sh— curl/assets/style.cssneedlebody {(Stdlib: strspn() and strcspn() VM + LLVM JIT/AOT #589)assets/using same manifest fieldAcceptance criteria
Docker:
No GitHub Actions required.
Dependencies
Links
examples/003-MiniWebApp/templates/layout.php