Stream
in package
implements
StreamInterface
Implements a data stream object
Table of Contents
Interfaces
- StreamInterface
Properties
- $readable : bool
- $seekable : bool
- $size : int|null
- $stream : resource|null
- $uri : string|null
- $writable : bool
Methods
- __construct() : mixed
- Stream constructor.
- __destruct() : void
- Closes the stream when the destructed
- __toString() : string
- close() : void
- detach() : mixed
- eof() : bool
- getContents() : string
- getMetadata() : mixed
- getSize() : int|null
- isReadable() : bool
- isSeekable() : bool
- isWritable() : bool
- read() : string
- rewind() : void
- seek() : void
- tell() : int
- write() : int
Properties
$readable
protected
bool
$readable
$seekable
protected
bool
$seekable
$size
protected
int|null
$size
= null
$stream
protected
resource|null
$stream
= null
$uri
protected
string|null
$uri
= null
$writable
protected
bool
$writable
Methods
__construct()
Stream constructor.
public
__construct(resource $stream) : mixed
Parameters
- $stream : resource
__destruct()
Closes the stream when the destructed
public
__destruct() : void
__toString()
public
__toString() : string
Return values
stringclose()
public
close() : void
detach()
public
detach() : mixed
eof()
public
eof() : bool
Return values
boolgetContents()
public
getContents() : string
Return values
stringgetMetadata()
public
getMetadata([string|null $key = null ]) : mixed
Parameters
- $key : string|null = null
getSize()
public
getSize() : int|null
Return values
int|nullisReadable()
public
isReadable() : bool
Return values
boolisSeekable()
public
isSeekable() : bool
Return values
boolisWritable()
public
isWritable() : bool
Return values
boolread()
public
read(int $length) : string
Parameters
- $length : int
Return values
stringrewind()
public
rewind() : void
seek()
public
seek(int $offset[, int $whence = SEEK_SET ]) : void
Parameters
- $offset : int
- $whence : int = SEEK_SET
tell()
public
tell() : int
Return values
intwrite()
public
write(string $string) : int
Parameters
- $string : string