Skip to content

Commit d904dbc

Browse files
author
Greg Bowler
committed
In memory read-write stream
1 parent 84ab00b commit d904dbc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Message.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function setHeaders(array $headers) {
221221
*/
222222
public function getBody() {
223223
if(!$this->stream) {
224-
$this->stream = new Stream("/tmp/greg");
224+
$this->stream = new Stream("php://memory");
225225
}
226226
return $this->stream;
227227
}

src/Stream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Stream implements StreamInterface {
1313
protected $isWritable;
1414
protected $uri;
1515

16-
public function __construct(string $path, string $mode = "r") {
16+
public function __construct(string $path, string $mode = "r+") {
1717
$this->stream = fopen($path, $mode);
1818
$streamInfo = stream_get_meta_data($this->stream);
1919
$this->isSeekable = $streamInfo["seekable"];

0 commit comments

Comments
 (0)