Copied!

Lazily reads or writes to a file that is opened only after an IO operation take place on the stream.

CloneableFinalInstantiable
Methods
public __call(string $method, array $args)
 

Allow decorators to implement custom methods

  • return mixed
public __construct(string $filename, string $mode)
 
  • param string $filename File to lazily open
  • param string $mode fopen mode to use when opening the stream
public __get(string $name)
 

Magic method used to create a new stream if streams are not added in the constructor of a decorator (e.g., LazyOpenStream).

  • return \StreamInterface
public __toString() : string
public close() : void
public detach()
public eof() : bool
public getContents() : string
public getMetadata( $key = NULL)
 
  • return mixed
public getSize() : ?int
public isReadable() : bool
public isSeekable() : bool
public isWritable() : bool
public read( $length) : string
public rewind() : void
public seek( $offset, $whence = 0GuzzleHttp\Psr7\SEEK_SET) : void
public tell() : int
public write( $string) : int
Methods
protected createStream() : Psr\Http\Message\StreamInterface
 

Creates the underlying stream lazily when required.

Properties
private $filename = NULL
 
  • var string
private $mode = NULL
 
  • var string
private $stream = NULL
 
  • var \StreamInterface
© 2025 Bruce Wells