Use HttpFoundation

This commit is contained in:
2026-01-04 20:15:05 +01:00
parent b3b1718d62
commit 930a4b6772
3 changed files with 22 additions and 3 deletions

View File

@ -1,5 +1,14 @@
<?php
$name = $_GET['name'] ?? 'poopstink';
require_once __DIR__.'/vendor/autoload.php';
printf('Hello %s', $name);
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
$request = Request::createFromGlobals();
$name = $request->query->get('name', 'Dingo');
$response = new Response(sprintf('Hello %s', htmlspecialchars($name, ENT_QUOTES, 'UTF-8')));
$response->send();