Skip to content

yopeso/php-custom-framework

Repository files navigation

Create your own PHP Framework

Presentation

Description

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 compatibility
  • league/route - PSR-7 and PSR-15 compatible router, based on fastroute
  • php-di/php-di - PSR-11 compatible Dependency Injection container
  • nyholm/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.

Compose Commands

  • 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)

About

Code from the "Create your own framework" workshop

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published