3
3
<img align =" right " src =" https://raw.githubusercontent.com/php-runtime/runtime/main/.github/logo.png " >
4
4
5
5
In early 2021, Symfony created a "Runtime component". This component may look
6
- complex, weird and full of hacks but it is a ** game changer** for how we run PHP
6
+ complex, weird, and full of hacks but it is a ** game- changer** for how we run PHP
7
7
applications.
8
8
9
9
With the Runtime component, we can look at each application as a "black box". A box
10
10
that has no connection to globals like ` $_SERVER ` or ` $_GET ` . To run the application
11
11
you need (you guessed it) a ` Runtime ` . It is a class that looks at the black box
12
12
to figure out what input it requires and handles the output.
13
13
14
- Consider this small application that returns an UUID.
14
+ Consider this small application that returns a UUID.
15
15
16
16
``` php
17
17
namespace Acme;
@@ -38,24 +38,24 @@ return function() {
38
38
If you want to use this application in a CLI environment, you need a
39
39
` Runtime ` that knows how to run an ` Acme\Application ` object and print the output on
40
40
CLI. If you want to use it with Nginx/PHP-FPM then you need another ` Runtime `
41
- that converts the application's output to a HTTP response.
41
+ that converts the application's output to an HTTP response.
42
42
43
43
## Why is this a good thing?
44
44
45
45
Since your application is not connected to the global state, it is very portable.
46
46
It is easy to create a ` Runtime ` to run the application with Bref, Swoole or
47
- ReactPHP without making any change to the application itself.
47
+ ReactPHP without making any changes to the application itself.
48
48
49
49
Since most modern PHP applications are based on Symfony's HttpKernel, PSR-7 or
50
50
PSR-15 we don't need too many different runtimes. This organization holds many PHP
51
51
packages with runtimes for the most popular environments. It is not "* the source of
52
52
all runtimes* ", but rather a temporary place where runtimes can live before they
53
- move in to Bref/Swoole/RoadRunner etc.
53
+ move into Bref/Swoole/RoadRunner etc.
54
54
55
55
All runtimes have hard dependencies to make installation easier. Everything should
56
56
"just work".
57
57
58
- Read more at the [ Symfony documentation] ( https://symfony.com/doc/5.3 /components/runtime.html ) .
58
+ Read more at the [ Symfony documentation] ( https://symfony.com/doc/current /components/runtime.html ) .
59
59
60
60
## Available Runtimes
61
61
@@ -127,7 +127,7 @@ The runtime for [Symfony](https://symfony.com/) is included in the runtime compo
127
127
## Note about sessions
128
128
129
129
On Symfony < 5.4 session data will not be properly stored when using a "non-traditional"
130
- webserver like Bref, Google, ReactPHP, RoadRunner or Swoole. This problem (or missing
130
+ webserver like Bref, Google, ReactPHP, RoadRunner, or Swoole. This problem (or missing
131
131
feature) has been added in Symfony 5.4 and 6.0. You need to use ` symfony/http-kernel >= 5.4 `
132
132
for sessions to work properly.
133
133
0 commit comments