Skip to content

[NFR]: crest init and a required crest.php #28

Closed

Description

@niden

Summary

Add crest init. It asks a few questions and writes crest.php in the project. After this change, crest.php is required: it marks a crest project and holds the project settings.

Why

  • Existing projects (for example vokuro-adr) have no crest.php. Today crest guesses the settings from composer.json and the folders.
  • One root rule: the project root is the folder with the nearest crest.php. The hand-off and the host commands (serve, up, down, install) use this rule.
  • The hand-off ([NFR]: Handoff to crest local #27) runs the project crest with the host PHP. A v5 project has ext-phalcon only in its container, so project commands fail on the host.
  • Moving a devtools project to crest: init is the entry point. It can read what the project already has, so that the move needs few or no manual steps.

Scope

  1. crest init
    • Proposes a value for each question, from the project: namespace (psr-4 in composer.json), flavor, paths (existing folders), front controller, runtime (docker-compose.yml and its service name).
    • --no-interaction accepts all the proposals (for CI). --force overwrites an existing crest.php.
    • Writes crest.php with the same stub that new uses.
    • If the project does not require phalcon/crest, it prints composer require --dev phalcon/crest.
    • Reads the settings of a devtools project where it can. New keys or options for this are allowed.
  2. crest.php is required for the project commands. Without it, crest stops with no crest.php found; run 'crest init'. The inference from composer.json (Config::infer()) is removed.
  3. A runtime key: host, or docker with the compose service. With docker, a global crest runs project commands as docker compose exec <service> vendor/bin/crest .... new writes this key.

Out of scope

Facts about the machine are not stored. Crest checks them each time it runs: is Phalcon loaded, does vendor/ exist, is docker installed. composer.json stays the source for autoload and the Phalcon variant.

Done when

  • crest init writes a working crest.php for vokuro-adr and for a project from crest new.
  • Without crest.php, project commands stop with the crest init hint.
  • The hand-off, serve, up, down and install find the root the same way.
  • With runtime set to docker, crest route:list works on a host without ext-phalcon (v5 project).
  • The docs are updated.

Related: #27 (hand-off), #16 (docs and release), X02 (published API), E09 (retire devtools).

Activity

  1. self-assigned this
    on Sep 27, 2026
  2. added theissue type on Sep 27, 2026
  3. added
    enhancement
    on Sep 27, 2026
  4. niden commented on Oct 9, 2026

    @niden
    SponsorMemberAuthor

    Resolved in #37

  5. moved this from Backlog to Implemented in Phalcon v5on Oct 9, 2026
  6. moved this from Implemented to Released in Phalcon v5on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions