| @@ 21-34 (lines=14) @@ | ||
| 18 | * |
|
| 19 | * @see League\Flysystem\ReadInterface::readStream() |
|
| 20 | */ |
|
| 21 | public function readStream($path) |
|
| 22 | { |
|
| 23 | if ( ! $data = $this->read($path)) { |
|
| 24 | return false; |
|
| 25 | } |
|
| 26 | ||
| 27 | $stream = fopen('php://temp', 'w+b'); |
|
| 28 | fwrite($stream, $data['contents']); |
|
| 29 | rewind($stream); |
|
| 30 | $data['stream'] = $stream; |
|
| 31 | unset($data['contents']); |
|
| 32 | ||
| 33 | return $data; |
|
| 34 | } |
|
| 35 | /** |
|
| 36 | * Stream fallback delegator. |
|
| 37 | * |
|
| @@ 19-32 (lines=14) @@ | ||
| 16 | * |
|
| 17 | * @see League\Flysystem\ReadInterface::readStream() |
|
| 18 | */ |
|
| 19 | public function readStream($path) |
|
| 20 | { |
|
| 21 | if ( ! $data = $this->read($path)) { |
|
| 22 | return false; |
|
| 23 | } |
|
| 24 | ||
| 25 | $stream = fopen('php://temp', 'w+b'); |
|
| 26 | fwrite($stream, $data['contents']); |
|
| 27 | rewind($stream); |
|
| 28 | $data['stream'] = $stream; |
|
| 29 | unset($data['contents']); |
|
| 30 | ||
| 31 | return $data; |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * Reads a file. |
|