Skip to content

DevEx: phpc.json JSON Schema and phpc validate-manifest #263

@PurHur

Description

@PurHur

Problem

lib/Web/ProjectManifest.php reads a minimal phpc.json (binary field for phpc serve --aot). #106 and #155 will add entry, public, includes, and PSR-4 autoload, but there is no machine-readable schema or validator—typos fail late at serve/build time.

Goal

  • docs/phpc-json.schema.json (or schema/phpc.json) describing supported keys
  • ./phpc validate-manifest [dir] exits 0/1 with actionable errors (unknown keys, bad paths, missing public/index.php)

Scope (v1)

Acceptance criteria

echo '{"binary": "missing"}' > /tmp/phpc.json
./phpc validate-manifest /tmp
# exit 1, message: binary path not found

Verification (local only)

docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
  vendor/bin/phpunit --filter ProjectManifest

Dependencies

Related

  • lib/Web/ProjectManifest.php, bin/serve-aot.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions