yxorP Documentation

CachingStream
in package
implements StreamInterface Uses AStreamDecoratorTrait

Interfaces, Classes, Traits and Enums

StreamInterface
Describes a data stream.

Table of Contents

$remoteStream  : StreamInterface
$skipReadBytes  : int
__call()  : mixed
__construct()  : mixed
__get()  : mixed
__toString()  : mixed
close()  : void
Closes the stream and any underlying resources.
detach()  : mixed
eof()  : bool
Returns true if the stream is at the end of the stream.
getContents()  : string
getMetadata()  : mixed
getSize()  : mixed
Get the size of the stream if known.
isReadable()  : bool
isSeekable()  : bool
isWritable()  : bool
read()  : string
Read data from the stream.
rewind()  : mixed
Seek to the beginning of the stream.
seek()  : mixed
Seek to a position in the stream.
tell()  : int
write()  : int
Write data to the stream.
createStream()  : mixed
cacheEntireStream()  : int

Properties

Methods

__call()

public __call(mixed $method, array<string|int, mixed> $args) : mixed
Parameters
$method : mixed
$args : array<string|int, mixed>
Return values
mixed

close()

Closes the stream and any underlying resources.

public close() : void
Return values
void

eof()

Returns true if the stream is at the end of the stream.

public eof() : bool
Return values
bool

getMetadata()

public getMetadata([mixed $key = null ]) : mixed
Parameters
$key : mixed = null
Return values
mixed

getSize()

Get the size of the stream if known.

public getSize() : mixed
Return values
mixed

Returns the size in bytes if known, or null if unknown.

read()

Read data from the stream.

public read(int $length) : string
Parameters
$length : int

Read up to $length bytes from the object and return them. Fewer than $length bytes may be returned if underlying stream call returns fewer bytes.

Return values
string

Returns the data read from the stream, or an empty string if no bytes are available.

rewind()

Seek to the beginning of the stream.

public rewind() : mixed

If the stream is not seekable, this method will raise an exception; otherwise, it will perform a seek(0).

Return values
mixed

seek()

Seek to a position in the stream.

public seek(int $offset[, int $whence = SEEK_SET ]) : mixed
Parameters
$offset : int

Stream offset

$whence : int = SEEK_SET

Specifies how the cursor position will be calculated based on the seek offset. Valid values are identical to the built-in PHP $whence values for fseek(). SEEK_SET: Set position equal to offset bytes SEEK_CUR: Set position to current location plus offset SEEK_END: Set position to end-of-stream plus offset.

Return values
mixed

write()

Write data to the stream.

public write(string $string) : int
Parameters
$string : string

The string that is to be written.

Return values
int

Returns the number of bytes written to the stream.

cacheEntireStream()

private cacheEntireStream() : int
Return values
int

Search results