RequestBridge
class RequestBridge
Methods
Create an HttpFoundation request from a Swoole request.
Transform Swoole's server params to $_SERVER style.
Transform Swoole's file uploads to UploadedFile instances.
Transform nested file upload arrays (multi-file fields).
Normalize the trailing slash in the REQUEST_URI.
Details
at line 16
static Request
createFromSwoole(Request $swooleRequest)
Create an HttpFoundation request from a Swoole request.
at line 54
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 92
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 118
static protected array
transformNestedFiles(array $files)
Transform nested file upload arrays (multi-file fields).
at line 154
static protected array
normalizeTrailingSlash(array $server)
Normalize the trailing slash in the REQUEST_URI.
Done once during bridge creation, not per-request during matching. This eliminates the $request->duplicate() clone that Laravel does.