Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Goal: create a new ADR project with one command, and run it with docker or with PHP on the host.
Today a developer writes the front controller, public/index.php, composer.json and the docker files by hand. devtools had project for this. Crest replaces devtools, so it needs the same.
-
new <name> [--namespace=App] [--php=8.4] [--phalcon=v5] [--force]: scaffold an ADR project from stubs -
up [--build]:docker compose up -d -
down [--volumes]:docker compose down -
install:docker compose exec app composer install -
repl: interactive shell with the project container loaded (devtoolsconsole,shell,psysh). Needs a design first.
new
Writes eleven files: ten new stubs plus the existing action.stub.
my-app/
├── composer.json
├── crest.php
├── .env
├── .gitignore
├── .htrouter.php
├── README.md
├── docker-compose.yml
├── resources/docker/Dockerfile
├── public/index.php
└── src/
├── AppFront.php
└── Action/Get.php
- Generated from stubs, the same as every
make:*command.stub:publishmakes every file editable. - Runs nothing: no composer, no docker, no network. Either the tree is written or it is not.
composer.jsonis a stub.--phalcon=v5requiresext-phalcon: ^5.--phalcon=v6requiresphalcon/phalcon: ^6.0.--phptakesmajor.minoronly.--phalcontakesv5orv6only. Other values are rejected.<name>is the directory, not the namespace. It is validated as a name, not a path.- A non-empty target is refused unless
--forceis given. - The project commits to one Phalcon variant. The Dockerfile keeps only
ARG PHP_VERSION. A comment shows the two edits that switch the variant. - The container serves on port 8080:
php -S 0.0.0.0:8080 -t public .htrouter.php. newdoes not extendProjectCommand. No project exists yet, so it writescrest.phpand does not read it.- The seed action is a fixed
App\Action\Get.Conventioncannot name it, because there is novendor/yet. - ADR only. Other flavors add their own stub set later.
Closing output. The generated files are the same on every host. Only this text shows both paths:
Created my-app/
Nothing runs it yet. With docker:
cd my-app
crest up
crest install
Or with PHP and composer on the host:
cd my-app
composer install
crest serve
Then GET / answers from src/Action/Get.php
Until serve exists, the host path prints php -S directly.
up, down, install
- Thin wrappers for
docker compose. Crest wrote the compose file, so it owns theappservice name. - New
Crest\Process\Runnerinterface, withShellRunneras the default. Injected the same way asActionResolver. - A missing
dockerbinary reports as a normal crest error, not a PHP warning.
Done when
- Every generated PHP file parses and its imports resolve.
-
Config::discover()reads the generatedcrest.php. -
Project\Bootstrap::container()boots the generated front controller. No docker needed. -
up,downandinstallare tested with a fake runner that asserts the exact argv. - Name validation and refuse-unless-
--forceare tested, as for every generator.
A manual end-to-end run (generate, install, send a request) is a release check. It is not part of this issue.
Out of scope
- The global install (
composer global require phalcon/crest) that letsnew,up,downandinstallrun before a project exists. It is part of the release work. serve. It has its own issue.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Type
Projects
- StatusShow more project fieldsReleased
Activity
niden commentedon Sep 25, 2026
Resolved in #21