Problem
Contributors scaffolding #246 MiniWebApp, #274 example phpc.json, and #67 reference app hand-copy directory layouts. There is no phpc init command; ProjectManifest (#106) already reads phpc.json for phpc serve --aot, but new projects start from scratch.
Goal
phpc init [target-dir] writes a minimal, lint-clean web project:
target/
phpc.json # entry, binary, optional docroot
public/
index.php # hello + htmlspecialchars
README.md # phpc run / serve / build commands
Defaults should match #274 manifest shape and pass phpc lint public/index.php on a fresh clone.
Scope
Acceptance criteria
cd /tmp && rm -rf demo-app && mkdir demo-app && cd demo-app
/path/to/phpc init .
phpc lint public/index.php
phpc run public/index.php
Exit 0; output contains Hello.
Verification (local / Docker only)
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
vendor/bin/phpunit --filter PhpcInitTest
Dependencies
Links
Problem
Contributors scaffolding #246 MiniWebApp, #274 example
phpc.json, and #67 reference app hand-copy directory layouts. There is nophpc initcommand;ProjectManifest(#106) already readsphpc.jsonforphpc serve --aot, but new projects start from scratch.Goal
phpc init [target-dir]writes a minimal, lint-clean web project:Defaults should match #274 manifest shape and pass
phpc lint public/index.phpon a fresh clone.Scope
bin/phpc.phpwith--forceto overwritetemplates/init/or inline strings in phpc CLIphpc.json:"entry": "public/index.php","binary": ".phpc/bin/app"test/unit/PhpcInitTest.php: run init in temp dir, assert files exist,phpc lintexit 0Acceptance criteria
Exit 0; output contains
Hello.Verification (local / Docker only)
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \ vendor/bin/phpunit --filter PhpcInitTestDependencies
phpc lint --all(future: init + lint whole tree)Links
lib/Web/ProjectManifest.php,bin/phpc.php