forked from devsam/core
Dep: update
주로 PHAN
This commit is contained in:
+6
-3
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace GuzzleHttp\Psr7;
|
||||
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
@@ -76,8 +77,10 @@ class Stream implements StreamInterface
|
||||
public function __toString()
|
||||
{
|
||||
try {
|
||||
$this->seek(0);
|
||||
return (string) stream_get_contents($this->stream);
|
||||
if ($this->isSeekable()) {
|
||||
$this->seek(0);
|
||||
}
|
||||
return $this->getContents();
|
||||
} catch (\Exception $e) {
|
||||
return '';
|
||||
}
|
||||
@@ -193,7 +196,7 @@ class Stream implements StreamInterface
|
||||
public function seek($offset, $whence = SEEK_SET)
|
||||
{
|
||||
$whence = (int) $whence;
|
||||
|
||||
|
||||
if (!isset($this->stream)) {
|
||||
throw new \RuntimeException('Stream is detached');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user