Download the PHP package beauty-framework/core without Composer
On this page you can find all versions of the php package beauty-framework/core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package core
Beauty Core
The beauty-framework/core package is the foundation of the Beauty Framework β a PSR-compliant, high-performance runtime for building clean and maintainable REST and gRPC (todo) services. It brings together routing, middleware, dependency injection, event system, and configuration management into a modular and lightweight package optimized for use with RoadRunner.
Features
- Clean architecture: Separation of concerns, modular components.
- PSR standards: PSR-7, PSR-11, PSR-14, PSR-15 compliance.
- Route registration via PHP Attributes.
- Simple and extendable DI container using
php-di. - Attribute-based and runtime middleware pipeline.
- Event dispatcher and listener registration (PSR-14 compatible).
- Lightweight config system with runtime registry.
- CLI kernel with support for custom commands.
Installation
Usage
App Kernel
Kernel\App is the main entry point for your application. It boots the container, registers routes, middleware, events, and config, and starts request handling.
See in workers/http-worker.php in beauty-framework/app for a real-world example.
Routing System
beauty-framework/core includes an attribute-driven router with support for method-based route definitions and route-specific middleware.
Basic Example
Generate via CLI:
Dependency Injection (Container)
The framework uses a custom ContainerManager that wraps php-di and provides:
- Singleton bindings
- Auto-wiring
- Runtime container access via
ContainerRegistry ContainerAwareInterfacefor injecting container where needed
Configuration
Configuration is loaded from PHP files in config/*.php, and accessed via config function:
At runtime, the ConfigRegistry provides in-memory updates or overrides.
Event System
beauty-framework/core ships with a PSR-14-compatible event dispatcher. You can define events and listeners:
Event
Listener
Registering
Use ListenerRegistry:
Or generate via CLI:
π§΅ Middleware
The router supports global and route-specific middleware using PSR-15-style interfaces.
You can also use attributes like #[Middleware([AuthMiddleware::class])] on controller classes or methods.
Generate with stubs:
CLI Kernel
Define and register commands in config/commands.php, and theyβll be loaded automatically by the console kernel:
Or generate with stubs:
Testing
Coming soon: feature and unit tests for routing, DI, config, and event dispatching.
PSR Compliance
| Standard | Status |
|---|---|
| PSR-1 | β |
| PSR-4 | β |
| PSR-7 | β |
| PSR-11 | β |
| PSR-15 | β |
| PSR-14 | β |
Helpers
helpers/di.phpβ short helpers to access DI bindings.helpers/env.phpβ.envparsing and usage functions.
License
MIT
Contributing
Pull requests and discussions are welcome! Let's make this the most developer-friendly framework for building modern PHP services.
Related Modules
beauty-framework/http: PSR-7 request/response wrappersbeauty-framework/validation: Laravel-like request validationbeauty-framework/database: Lightweight query builderbeauty-framework/cache: PSR-6 cache adapterbeauty-framework/jobs: Fiber-based job runner with RoadRunner supportbeauty-framework/cli: Framework-aware CLI kernelbeauty-framework/parallels: Parallel processing with Fibers (todo: RoadRunner)
All versions of core with dependencies
beauty-framework/http Version ^1.0
beauty-framework/cli Version ^1.0
spiral/roadrunner Version ^2024
spiral/roadrunner-http Version ^3.4.0
symfony/finder Version ^7.3
spiral/roadrunner-cli Version ^2.2
php-di/php-di Version ^7.0
vlucas/phpdotenv Version ^5.6
roadrunner-php/lock Version ^1.0
psr/event-dispatcher Version ^1.0