Stream opens php://temp for binary read-write

This commit is contained in:
PJ Dietz 2015-06-01 19:07:08 -04:00
parent 18d6e5fc6a
commit 4429d4280b
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ class Stream implements StreamInterface
if (is_resource($resource) && get_resource_type($resource) === "stream") { if (is_resource($resource) && get_resource_type($resource) === "stream") {
$this->resource = $resource; $this->resource = $resource;
} elseif (is_string($resource)) { } elseif (is_string($resource)) {
$this->resource = fopen("php://temp", "r+"); $this->resource = fopen("php://temp", "wb+");
if ($resource !== "") { if ($resource !== "") {
$this->write($resource); $this->write($resource);
} }