diff options
author | Wolfy-J <[email protected]> | 2018-07-07 19:23:15 -0700 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-07-07 19:23:15 -0700 |
commit | 98f7ce699b559afd74d4e9d607e64b9a8367d762 (patch) | |
tree | a1553b7ed55109a1158f92dbf0eae5520754c5f7 /php-src | |
parent | afde365ba6210569b7d48dec0c07434a7f8a1fd8 (diff) |
attributes support
Diffstat (limited to 'php-src')
-rw-r--r-- | php-src/PSR7Client.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/php-src/PSR7Client.php b/php-src/PSR7Client.php index f8913a8d..d1d8ee8c 100644 --- a/php-src/PSR7Client.php +++ b/php-src/PSR7Client.php @@ -9,6 +9,7 @@ namespace Spiral\RoadRunner; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; +use Spiral\RoadRunner\Worker; use Zend\Diactoros; /** @@ -64,7 +65,7 @@ class PSR7Client $bodyStream->write($body); } - return new Diactoros\ServerRequest( + $request = new Diactoros\ServerRequest( $_SERVER, $this->wrapUploads($ctx['uploads']), $ctx['uri'], @@ -76,6 +77,14 @@ class PSR7Client $parsedBody, $ctx['protocol'] ); + + if (!empty($ctx['attributes'])) { + foreach ($ctx['attributes'] as $key => $value) { + $request = $request->withAttribute($key, $value); + } + } + + return $request; } /** |