final class LeasedStream

Constants

PROTOCOL

Properties

resource $context

Methods

static mixed
wrap(mixed $resource, Lease $lease)

Wrap a resource so its lease is finalized when the stream closes.

bool
stream_open(string $path, string $mode, int $options, string|null $openedPath)

Open a leased stream from its private stream context.

false|string
stream_read(int $count)

Read from the inner stream.

bool
stream_eof()

Determine if the inner stream is at end-of-file.

bool
stream_seek(int $offset, int $whence = SEEK_SET)

Seek to a position in the inner stream.

false|int
stream_tell()

Get the current inner-stream position.

array|false
stream_stat()

Get statistics for the inner stream.

mixed
stream_cast(int $castAs)

Expose the inner stream to resource-casting APIs.

bool
stream_set_option(int $option, int $arg1, int|null $arg2)

Apply supported stream options to the inner stream.

void
stream_close()

Close the inner stream and finalize its lease without throwing.

Details

at line 33
static mixed wrap(mixed $resource, Lease $lease)

Wrap a resource so its lease is finalized when the stream closes.

Parameters

mixed $resource
Lease $lease

Return Value

mixed

at line 94
bool stream_open(string $path, string $mode, int $options, string|null $openedPath)

Open a leased stream from its private stream context.

Parameters

string $path
string $mode
int $options
string|null $openedPath

Return Value

bool

at line 114
false|string stream_read(int $count)

Read from the inner stream.

Parameters

int $count

Return Value

false|string

at line 122
bool stream_eof()

Determine if the inner stream is at end-of-file.

Return Value

bool

at line 130
bool stream_seek(int $offset, int $whence = SEEK_SET)

Seek to a position in the inner stream.

Parameters

int $offset
int $whence

Return Value

bool

at line 138
false|int stream_tell()

Get the current inner-stream position.

Return Value

false|int

at line 146
array|false stream_stat()

Get statistics for the inner stream.

Return Value

array|false

at line 156
mixed stream_cast(int $castAs)

Expose the inner stream to resource-casting APIs.

Parameters

int $castAs

Return Value

mixed

at line 164
bool stream_set_option(int $option, int $arg1, int|null $arg2)

Apply supported stream options to the inner stream.

Parameters

int $option
int $arg1
int|null $arg2

Return Value

bool

at line 185
void stream_close()

Close the inner stream and finalize its lease without throwing.

Return Value

void