componenta / cycle-app
Componenta application integration for Cycle ORM discovery and console commands
Requires
- php: ^8.4
- componenta/app-console: ^5.0.0
- componenta/class-finder: ^2.1.0
- componenta/config: ^3.0.0
- componenta/cycle: ^1.1.1
- componenta/tokenizer: ^1.0
- componenta/var-export: ^2.0.0
- cycle/annotated: ^4.4
- cycle/database: ^2.11
- cycle/migrations: ^4.2
- cycle/orm: ^2.11
- cycle/schema-builder: ^2.11
- cycle/schema-migrations-generator: ^2.3
- psr/container: ^2.0
- symfony/console: ^7.4 || ^8.0
Requires (Dev)
- ext-pdo_sqlite: *
- pestphp/pest: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Application integration for componenta/cycle. This package connects Cycle runtime services to framework discovery and console commands.
Use it in a Componenta application that wants framework-managed Cycle discovery. Libraries should depend on componenta/cycle only.
Installation
composer require componenta/cycle-app
Register its provider after the Cycle runtime provider:
return [ new Componenta\Cycle\ConfigProvider(), new Componenta\Cycle\App\ConfigProvider(), ];
Related Packages
| Package | Why it matters here |
|---|---|
componenta/cycle |
Owns repositories, data fetchers, filters, typecasts, and runtime factories. |
componenta/class-finder |
Finds entities and embeddables in configured directories. |
componenta/app |
Prepares shared discovery and runs the application bootloaders. |
cycle/orm |
Consumes the final ORM configuration. |
What It Adds
The package provides app-level integration for:
- entity and embeddable discovery
- locator services backed by the configured class iterator
ClassFinderConfigKey::LISTENERSentries forEntityLocatorandEmbeddingLocator- Cycle-related console commands registered through
Componenta\App\Console\ConfigKey::COMMANDS
Console Commands
When componenta/app-console is installed, this package contributes the database commands below to the shared console command graph. They are registered through configuration in both development and production.
| Command | Purpose |
|---|---|
db:create |
Create the configured database when the driver supports it. |
db:generate |
Generate migrations from the current ORM schema diff. |
db:schema |
Generate and cache the Cycle ORM schema. |
db:migrate |
Execute pending migrations. |
db:rollback |
Roll back migrations. |
db:status |
Show migration status. |
db:sync |
Generate and apply migrations, then regenerate ORM schema. |
php bin/console.php db:status php bin/console.php db:migrate php bin/console.php db:sync
Discovery and ORM Schema
Entity and embeddable locators use the application's shared class iterator in both development and production. ConfigFactory prepares this iterator, and the class discovery bootloader notifies the registered listeners.
Generate the ORM schema with db:schema, or as part of db:sync or db:migrate --schema. The Cycle runtime creates its schema from the resulting application configuration.
Boundaries
This package should not contain persistence behavior that a runtime consumer needs directly. Repositories, data fetchers, filters, typecasts, and runtime factories belong to componenta/cycle.