You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#632 / #1886 established phpc init --profile miniwebapp and sessionsweb with template parity checkers (#695, #1902). 004-ApiJson is a shipped JSON API example (http_response_code, json_encode) but contributors cannot scaffold it via CLI.
Problem
#632 / #1886 established
phpc init --profile miniwebappandsessionswebwith template parity checkers (#695, #1902). 004-ApiJson is a shipped JSON API example (http_response_code,json_encode) but contributors cannot scaffold it via CLI.Goal
Produces a tree byte-synced to
examples/004-ApiJson/(policy like #695 / #1902).Scope
templates/init-apijson/examples/004-ApiJson/(example.php,phpc.json,README.md)lib/Cli/PhpcInit.phpPROFILE_APIJSON = 'apijson'; help textscript/check-init-apijson-parity.sh— implement there, not heretest/unit/PhpcInitApiJsonTest.phptest/unit/PhpcInitSessionsWebTest.phpdocs/phpc-json.md,examples/README.md,./phpc init --helpImplementation hints
examples/004-ApiJson/example.phpusesjson_encode+http_response_code; keep minimal manifest:{ "entry": "example.php", "binary": ".phpc/bin/app" }PhpcInit.php— add profile constant +copyTemplate('init-apijson', $target)branch (grepsessionsweb/PROFILE_SESSIONSWEB).PHPUnit — assert
phpc init --profile apijsoncreatesexample.php+phpc.json; lint passes.After merge — flip
APIJSON_INIT_PARITY_GATE=1default in ci-fast (follow-up issue; checker tracked in DevEx: check-init-apijson-parity.sh — template ↔ examples/004-ApiJson (#695 pattern) #2029).Acceptance criteria
./script/ci-fast.sh --filter PhpcInitApiJson ./phpc init --profile apijson /tmp/apijson-test && ./phpc lint /tmp/apijson-test/example.phpVerification (local / Docker only)
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \ vendor/bin/phpunit --filter PhpcInitApiJsonNo GitHub Actions.
Dependencies
phpc.jsonstubsLinks