borschphp / application
Borsch Framework application.
1.0.2
2024-04-29 12:53 UTC
Requires
- php: ^8.1
- borschphp/container: ^1
- borschphp/requesthandler: ^1
- borschphp/router: ^2
- psr/log: ^1.0 || ^2.0 || ^3.0
Requires (Dev)
README
Borsch Framework application wrapper.
This package is part of the Borsch Framework.
Installation
Via composer :
composer require borschphp/application
Usage
$container = new Container(); $container->set(PipePathMiddleware::class); $container->set(RouteMiddleware::class); $container->set(DispatchMiddleware::class); $container->set(NotFoundHandlerMiddleware::class); $container->set(TestHandler::class); $container->set(FastRouteRouter::class); $container->set(RouterInterface::class, FastRouteRouter::class)->cache(true); $app = new App( new RequestHandler(), $container->get(RouterInterface::class), $container ); $app->pipe(RouteMiddleware::class); $app->pipe(DispatchMiddleware::class); $app->pipe(NotFoundHandlerMiddleware::class); $app->get('/a/get/path', TestHandler::class); $app->run(ServerRequestFactory::fromGlobals());
License
The package is licensed under the MIT license. See License File for more information.