@startuml
!include .config.puml
' Participants
$clientWithBrowser()
$serverWithPhp("Serveur Web local\navec module PHP")
' Client
note left of Client : Le client saisit l'URL\n""http://example.com/hello.php""
' Connect
$connect()
' Client
note left of Client : Préparation de la requête
' Request
$request("**Requête HTTP demandant** "+$resource("/hello.php"))
' Server
note right of Server : Traitement de la requête
note right of Server : Le serveur cherche la ressource\ndemandée $resource("/hello.php")
note right of Server : Contenu de la ressource localisée :\n\
\n\
hello.php\n\
\n\
HTML;\n\
\n\
$html .= str_repeat("{$x} ", 8);\n\
\n\
$html .= <<\n\
\n\
HTML;\n\
\n\
echo $html;
note right of Server : La ressource $resource("/hello.php")\ncontient du code PHP
Server -[hidden]-> PHP
Server -[$phpColor]->> PHP: Demande d'exécution du code PHP
activate PHP $phpColor
note right of PHP : \n\
**Exécution du**\n\
**script ""hello.php""**
note right of PHP : Production de la\ncharge utile avec **""echo""**
note right of PHP : Charge utile produite :\n\
\n\
hello.php\n\
12 12 12 12 12 12 12 12 \n\
PHP -[$phpColor]->> Server: **Construction de la réponse HTTP**
note right of Server : Réponse HTTP :\n\
HTTP/1.x 200 OK\n\
Content-Length: 104\n\
Content-Type: text/html\n\
\n\
\n\
hello.php\n\
12 12 12 12 12 12 12 12 \n\
deactivate PHP
' Response
$response("**Réponse HTTP contenant le résultat**\n**de l'exécution de **"\
+$resource("/hello.php")\
+"\n"+$borderbox("HTTP/1.x 200 OK\n\
Content-Length: 104\n\
Content-Type: text/html\n\
.\n\
\n\
hello.php\n\
12 12 12 12 12 12 12 12 \n\
"))
' Disconnect
$disconnect()
note left of Client : Interprétation de la réponse
note left of Client : Rendu graphique :\n
@enduml