ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
StreamedReadingTrait.php
Go to the documentation of this file.
1 <?php
2 
4 
9 {
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 
43  abstract public function read($path);
44 }
trait StreamedReadingTrait
A helper for adapters that only handle strings to provide read streams.
$stream
PHP stream implementation.