RequestBridge
class RequestBridge
Methods
Create an HttpFoundation request from a Swoole request.
Build request headers directly while retaining Symfony's authorization aliases.
Transform Swoole's server params to $_SERVER style.
Transform Swoole's file uploads to UploadedFile instances.
Transform nested file upload arrays (multi-file fields).
Extract the raw path from the Swoole request URI, which keeps its trailing slash as Laravel's does.
Details
at line 16
static Request
createFromSwoole(Request $swooleRequest)
Create an HttpFoundation request from a Swoole request.
at line 62
static protected RequestHeaderBag
transformHeaders(array $headers, array $server)
Build request headers directly while retaining Symfony's authorization aliases.
at line 120
static protected array
transformServerParams(array $server, array $headers)
Transform Swoole's server params to $_SERVER style.
Swoole uses lowercase keys and splits headers from server vars. HttpFoundation expects $SERVER-style uppercase keys with HTTP prefix for headers.
at line 175
static protected array
transformFiles(array $files)
Transform Swoole's file uploads to UploadedFile instances.
Swoole provides files in $_FILES format. We construct UploadedFile objects with $test=true because Swoole's CLI SAPI means PHP's is_uploaded_file() and move_uploaded_file() don't recognize Swoole-received uploads. Symfony's $test flag makes isValid() skip is_uploaded_file() and move() use rename() instead of move_uploaded_file().
UploadedFile instances constructed here pass through FileBag unchanged because FileBag::convertFileInformation returns them as-is.
at line 201
static protected array
transformNestedFiles(array $files)
Transform nested file upload arrays (multi-file fields).
at line 238
static protected string|null
extractPathInfo(array $server)
Extract the raw path from the Swoole request URI, which keeps its trailing slash as Laravel's does.
Route matching trims trailing slashes itself, so the request keeps the target it arrived with for anything that reads it, such as URL signatures.