class RequestBridge

Methods

static Request
createFromSwoole(Request $swooleRequest)

Create an HttpFoundation request from a Swoole request.

static array
transformServerParams(array $server, array $headers)

Transform Swoole's server params to $_SERVER style.

static array
transformFiles(array $files)

Transform Swoole's file uploads to UploadedFile instances.

static array
transformNestedFiles(array $files)

Transform nested file upload arrays (multi-file fields).

static array
normalizeTrailingSlash(array $server)

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.

Parameters

Request $swooleRequest

Return Value

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.

Parameters

array $server
array $headers

Return Value

array

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.

Parameters

array $files

Return Value

array

at line 118
static protected array transformNestedFiles(array $files)

Transform nested file upload arrays (multi-file fields).

Parameters

array $files

Return Value

array

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.

Parameters

array $server

Return Value

array