The goal of this presentation / workshop is to provide an insight into the importance of PSR components in PHP as well as provide a practical introduction into using PSR components to create a basic framework.
This example puts together the following components:
spiral/roadrunner
- this provides a worker system execute by a Go process which uses PHP CLI to execute. Provides basic PSR-7 compatibilityleague/route
- PSR-7 and PSR-15 compatible router, based on fastroutephp-di/php-di
- PSR-11 compatible Dependency Injection containernyholm/psr7
- the most popular PSR-7 package that implements request/response creation
PHPDI was also used to exemplify autowiring concepts and boostrapping a lightweight API-like application.
Roadrunner provides HTTP request handling, effectively replacing the FPM/NGINX combo for faster execution in a single container.
docker compose run -it cli
- enter a simple CLI with PHP (can also execute any command)docker compose run fix
- execute coding standards static check (with EasyCodingStandard)docker compose up -d
- start the web service (composer install / get RoadRunner / serve application)