Skip to content

DevEx: phpc init --profile miniwebapp (Router + templates scaffold) #632

Description

@PurHur

Problem

#312 ✅ ships a minimal phpc init tree (public/index.php hello page). Contributors building the north-star app still hand-copy examples/003-MiniWebApp/ (Router, templates/, config.php, includes[] in phpc.json).

There is no one-command scaffold that matches the reference layout and passes phpc lint --all on day one.

Goal

phpc init --profile miniwebapp my-app
cd my-app
phpc lint --all .
phpc serve 127.0.0.1:8080 .
curl -s 'http://127.0.0.1:8080/index.php?route=home'

Emit a lint-clean subset of the 003 layout (not a full copy of shipped example sources):

my-app/
  phpc.json              # entry, binary, public, includes[], assets/
  config.php
  public/index.php       # ?route= + PATH_INFO stub
  src/Router.php         # switch dispatch (VM-only constructs)
  templates/layout.php
  templates/home.php
  assets/style.css
  README.md              # curl recipes + gate ladder link (#472)

Scope

Acceptance criteria

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

No GitHub Actions.

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