ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
LazyOpenStream.php
Go to the documentation of this file.
1 <?php
2 namespace GuzzleHttp\Psr7;
3 
5 
11 {
13 
15  private $filename;
16 
18  private $mode;
19 
24  public function __construct($filename, $mode)
25  {
26  $this->filename = $filename;
27  $this->mode = $mode;
28  }
29 
35  protected function createStream()
36  {
37  return stream_for(try_fopen($this->filename, $this->mode));
38  }
39 }
stream_for($resource='', array $options=[])
Create a new stream based on the input type.
Definition: functions.php:78
createStream()
Creates the underlying stream lazily when required.
Lazily reads or writes to a file that is opened only after an IO operation take place on the stream...
Describes a data stream.