Skip to content

DevEx: phpc init — scaffold minimal web project (phpc.json + public/) #312

Description

@PurHur

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions