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
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:publish makes every file editable.
- Runs nothing: no composer, no docker, no network. Either the tree is written or it is not.
composer.json is a stub. --phalcon=v5 requires ext-phalcon: ^5. --phalcon=v6 requires phalcon/phalcon: ^6.0.
--php takes major.minor only. --phalcon takes v5 or v6 only. 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
--force is 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.
new does not extend ProjectCommand. No project exists yet, so it writes crest.php and does not read it.
- The seed action is a fixed
App\Action\Get. Convention cannot name it, because there is no vendor/ 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 the app service name.
- New
Crest\Process\Runner interface, with ShellRunner as the default. Injected the same way as ActionResolver.
- A missing
docker binary reports as a normal crest error, not a PHP warning.
Done when
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 lets new, up, down and install run before a project exists. It is part of the release work.
serve. It has its own issue.
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.jsonand the docker files by hand. devtools hadprojectfor this. Crest replaces devtools, so it needs the same.new <name> [--namespace=App] [--php=8.4] [--phalcon=v5] [--force]: scaffold an ADR project from stubsup [--build]:docker compose up -ddown [--volumes]:docker compose downinstall:docker compose exec app composer installrepl: interactive shell with the project container loaded (devtoolsconsole,shell,psysh). Needs a design first.newWrites eleven files: ten new stubs plus the existing
action.stub.make:*command.stub:publishmakes every file editable.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.--forceis given.ARG PHP_VERSION. A comment shows the two edits that switch the variant.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.App\Action\Get.Conventioncannot name it, because there is novendor/yet.Closing output. The generated files are the same on every host. Only this text shows both paths:
Until
serveexists, the host path printsphp -Sdirectly.up,down,installdocker compose. Crest wrote the compose file, so it owns theappservice name.Crest\Process\Runnerinterface, withShellRunneras the default. Injected the same way asActionResolver.dockerbinary reports as a normal crest error, not a PHP warning.Done when
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.--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
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.