@@ -128,6 +128,31 @@ $request = RequestFactory::fromGlobals(
128
128
);
129
129
```
130
130
131
+ ### ServerRequestFactory helper functions
132
+
133
+ - Since 1.8.0
134
+
135
+ In order to create the various artifacts required by a ` ServerRequest ` instance,
136
+ Diactoros also provides a number of functions under the ` Zend\Diactoros `
137
+ namespace for introspecting the SAPI ` $_SERVER ` parameters, headers, ` $_FILES ` ,
138
+ and even the ` Cookie ` header. These include:
139
+
140
+ - ` Zend\Diactoros\normalizeServer(array $server, callable $apacheRequestHeaderCallback = null) : array `
141
+ (its main purpose is to aggregate the ` Authorization ` header in the SAPI params
142
+ when under Apache)
143
+ - ` Zend\Diactoros\marshalProtocolVersionFromSapi(array $server) : string `
144
+ - ` Zend\Diactoros\marshalMethodFromSapi(array $server) : string `
145
+ - ` Zend\Diactoros\marshalUriFromSapi(array $server, array $headers) : Uri `
146
+ - ` Zend\Diactoros\marshalHeadersFromSapi(array $server) : array `
147
+ - ` Zend\Diactoros\parseCookieHeader(string $header) : array `
148
+ - ` Zend\Diactoros\createUploadedFile(array $spec) : UploadedFile ` (creates the
149
+ instance from a normal ` $_FILES ` entry)
150
+ - ` Zend\Diactoros\normalizeUploadedFiles(array $files) : UploadedFileInterface[] `
151
+ (traverses a potentially nested array of uploaded file instances and/or
152
+ ` $_FILES ` entries, including those aggregated under mod_php, php-fpm, and
153
+ php-cgi in order to create a flat array of ` UploadedFileInterface ` instances
154
+ to use in a request)
155
+
131
156
## URI
132
157
133
158
` Zend\Diactoros\Uri ` is an implementation of
0 commit comments