Opulence - A modern framework for modern PHP
$router->get('/welcome/:name', function (string $name) {
return "Welcome to Opulence, $name!";
});
Installing
composer create-project opulence/project --prefer-dist
Features
Views
Create extendable, cacheable views using FortuneMiddleware
Use middleware to manipulate your HTTP requests and responsesORM
Use plain-old PHP objects and the repository and data mapper patterns for your ORMConsole
Write your own powerful console commands using ApexTesting
Integration test all your HTTP routes and console commandsWhy Use Opulence?
Loosely coupled
- Automatically instantiate controllers with the DI container.
- 22 out of 24 components have 0 dependencies.
Doesn't bleed into your code
- Use plain-old PHP objects as controllers.
- Use plain-old PHP objects in its ORM.
- Clear separation of application code and domain logic.
No magic, just SOLID code
- No magic under the hood. The internals are easy to understand and extend.
- All Opulence components are unit-testable.
- No "God" classes.
Fast
- Written for PHP 7.3+.
- Handles ~1000 requests/second on a simple 2GB dual-core server.
Scalable
- Heavy caching in data mappers.
- Automatic caching of compiled views.
- Session support for multiple servers.
Secure
- Built-in encryption that uses the latest secure practices.
- Cross-site scripting prevention.
- Cross-site request forgery prevention.