ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Represents a data stream as defined in PSR-7. More...
Public Member Functions | |
__construct ($stream) | |
Create a new Stream. More... | |
getMetadata ($key=null) | |
Get stream metadata as an associative array or retrieve a specific key. More... | |
detach () | |
Separates any underlying resources from the stream. More... | |
__toString () | |
Reads all data from the stream into a string, from the beginning to end. More... | |
close () | |
Closes the stream and any underlying resources. More... | |
getSize () | |
Get the size of the stream if known. More... | |
tell () | |
Returns the current position of the file read/write pointer. More... | |
eof () | |
Returns true if the stream is at the end of the stream. More... | |
isReadable () | |
Returns whether or not the stream is readable. More... | |
isWritable () | |
Returns whether or not the stream is writable. More... | |
isSeekable () | |
Returns whether or not the stream is seekable. More... | |
seek ($offset, $whence=SEEK_SET) | |
Seek to a position in the stream. More... | |
rewind () | |
Seek to the beginning of the stream. More... | |
read ($length) | |
Read data from the stream. More... | |
write ($string) | |
Write data to the stream. More... | |
getContents () | |
Returns the remaining contents in a string. More... | |
isPipe () | |
Returns whether or not the stream is a pipe. More... | |
Data Fields | |
const | FSTAT_MODE_S_IFIFO = 0010000 |
Bit mask to determine if the stream is a pipe. More... | |
Protected Member Functions | |
isAttached () | |
Is a resource attached to this stream? More... | |
attach ($newStream) | |
Attach new resource to this object. More... | |
Protected Attributes | |
$stream | |
$meta | |
$readable | |
$writable | |
$seekable | |
$size | |
$isPipe | |
Static Protected Attributes | |
static | $modes |
Represents a data stream as defined in PSR-7.
https://github.com/php-fig/http-message/blob/master/src/StreamInterface.php
Definition at line 20 of file Stream.php.
Slim\Http\Stream::__construct | ( | $stream | ) |
Create a new Stream.
resource | $stream | A PHP resource handle. |
InvalidArgumentException | If argument is not a resource. |
Definition at line 96 of file Stream.php.
References Slim\Http\Stream\$stream, and Slim\Http\Stream\attach().
Slim\Http\Stream::__toString | ( | ) |
Reads all data from the stream into a string, from the beginning to end.
This method MUST attempt to seek to the beginning of the stream before reading data and read the stream until the end is reached.
Warning: This could attempt to load a large amount of data into memory.
This method MUST NOT raise an exception in order to conform with PHP's string casting operations.
Implements Psr\Http\Message\StreamInterface.
Definition at line 194 of file Stream.php.
References Slim\Http\Stream\getContents(), Slim\Http\Stream\isAttached(), and Slim\Http\Stream\rewind().
|
protected |
Attach new resource to this object.
Note: This method is not part of the PSR-7 standard.
resource | $newStream | A PHP resource handle. |
InvalidArgumentException | If argument is not a valid PHP resource. |
Definition at line 146 of file Stream.php.
References Slim\Http\Stream\detach(), and Slim\Http\Stream\isAttached().
Referenced by Slim\Http\Stream\__construct().
Slim\Http\Stream::close | ( | ) |
Closes the stream and any underlying resources.
Implements Psr\Http\Message\StreamInterface.
Definition at line 211 of file Stream.php.
References Slim\Http\Stream\detach(), Slim\Http\Stream\isAttached(), and Slim\Http\Stream\isPipe().
Slim\Http\Stream::detach | ( | ) |
Separates any underlying resources from the stream.
After the stream has been detached, the stream is in an unusable state.
Implements Psr\Http\Message\StreamInterface.
Definition at line 166 of file Stream.php.
References Slim\Http\Stream\$stream, Slim\Http\Stream\isPipe(), and size.
Referenced by Slim\Http\Stream\attach(), and Slim\Http\Stream\close().
Slim\Http\Stream::eof | ( | ) |
Returns true if the stream is at the end of the stream.
Implements Psr\Http\Message\StreamInterface.
Definition at line 260 of file Stream.php.
References Slim\Http\Stream\isAttached().
Slim\Http\Stream::getContents | ( | ) |
Returns the remaining contents in a string.
RuntimeException | if unable to read or an error occurs while reading. |
Implements Psr\Http\Message\StreamInterface.
Definition at line 424 of file Stream.php.
References $contents, and Slim\Http\Stream\isReadable().
Referenced by Slim\Http\Stream\__toString().
Slim\Http\Stream::getMetadata | ( | $key = null | ) |
Get stream metadata as an associative array or retrieve a specific key.
The keys returned are identical to the keys returned from PHP's stream_get_meta_data() function.
Implements Psr\Http\Message\StreamInterface.
Definition at line 115 of file Stream.php.
References $key, and Slim\Http\Stream\$meta.
Referenced by Slim\Http\Stream\isReadable(), Slim\Http\Stream\isSeekable(), and Slim\Http\Stream\isWritable().
Slim\Http\Stream::getSize | ( | ) |
Get the size of the stream if known.
Implements Psr\Http\Message\StreamInterface.
Definition at line 229 of file Stream.php.
References Slim\Http\Stream\$size, $stats, Slim\Http\Stream\isAttached(), Slim\Http\Stream\isPipe(), and size.
|
protected |
Is a resource attached to this stream?
Note: This method is not part of the PSR-7 standard.
Definition at line 132 of file Stream.php.
Referenced by Slim\Http\Stream\__toString(), Slim\Http\Stream\attach(), Slim\Http\Stream\close(), Slim\Http\Stream\eof(), Slim\Http\Stream\getSize(), Slim\Http\Stream\isPipe(), Slim\Http\Stream\isReadable(), Slim\Http\Stream\isSeekable(), Slim\Http\Stream\isWritable(), and Slim\Http\Stream\tell().
Slim\Http\Stream::isPipe | ( | ) |
Returns whether or not the stream is a pipe.
Definition at line 438 of file Stream.php.
References Slim\Http\Stream\$isPipe, and Slim\Http\Stream\isAttached().
Referenced by Slim\Http\Stream\close(), Slim\Http\Stream\detach(), Slim\Http\Stream\getSize(), Slim\Http\Stream\isReadable(), Slim\Http\Stream\isSeekable(), and Slim\Http\Stream\tell().
Slim\Http\Stream::isReadable | ( | ) |
Returns whether or not the stream is readable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 270 of file Stream.php.
References Slim\Http\Stream\$meta, Slim\Http\Stream\$readable, Slim\Http\Stream\getMetadata(), Slim\Http\Stream\isAttached(), and Slim\Http\Stream\isPipe().
Referenced by Slim\Http\Stream\getContents(), and Slim\Http\Stream\read().
Slim\Http\Stream::isSeekable | ( | ) |
Returns whether or not the stream is seekable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 320 of file Stream.php.
References Slim\Http\Stream\$meta, Slim\Http\Stream\$seekable, Slim\Http\Stream\getMetadata(), Slim\Http\Stream\isAttached(), and Slim\Http\Stream\isPipe().
Referenced by Slim\Http\Stream\rewind(), and Slim\Http\Stream\seek().
Slim\Http\Stream::isWritable | ( | ) |
Returns whether or not the stream is writable.
Implements Psr\Http\Message\StreamInterface.
Definition at line 297 of file Stream.php.
References Slim\Http\Stream\$meta, Slim\Http\Stream\$writable, Slim\Http\Stream\getMetadata(), and Slim\Http\Stream\isAttached().
Referenced by Slim\Http\Stream\write().
Slim\Http\Stream::read | ( | $length | ) |
Read data from the stream.
int | $length | 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. |
RuntimeException | if an error occurs. |
Implements Psr\Http\Message\StreamInterface.
Definition at line 386 of file Stream.php.
References $data, and Slim\Http\Stream\isReadable().
Slim\Http\Stream::rewind | ( | ) |
Seek to the beginning of the stream.
If the stream is not seekable, this method will raise an exception; otherwise, it will perform a seek(0).
Implements Psr\Http\Message\StreamInterface.
Definition at line 367 of file Stream.php.
References Slim\Http\Stream\isSeekable().
Referenced by Slim\Http\RequestBody\__construct(), and Slim\Http\Stream\__toString().
Slim\Http\Stream::seek | ( | $offset, | |
$whence = SEEK_SET |
|||
) |
Seek to a position in the stream.
Implements Psr\Http\Message\StreamInterface.
Definition at line 347 of file Stream.php.
References Slim\Http\Stream\isSeekable().
Slim\Http\Stream::tell | ( | ) |
Returns the current position of the file read/write pointer.
RuntimeException | on error. |
Implements Psr\Http\Message\StreamInterface.
Definition at line 246 of file Stream.php.
References Slim\Http\Stream\isAttached(), and Slim\Http\Stream\isPipe().
Slim\Http\Stream::write | ( | $string | ) |
Write data to the stream.
string | $string | The string that is to be written. |
RuntimeException | on failure. |
Implements Psr\Http\Message\StreamInterface.
Definition at line 404 of file Stream.php.
References Slim\Http\Stream\isWritable(), and size.
|
protected |
Definition at line 87 of file Stream.php.
Referenced by Slim\Http\Stream\isPipe().
|
protected |
Definition at line 52 of file Stream.php.
Referenced by Slim\Http\Stream\getMetadata(), Slim\Http\Stream\isReadable(), Slim\Http\Stream\isSeekable(), and Slim\Http\Stream\isWritable().
|
staticprotected |
Definition at line 35 of file Stream.php.
|
protected |
Definition at line 59 of file Stream.php.
Referenced by Slim\Http\Stream\isReadable().
|
protected |
Definition at line 73 of file Stream.php.
Referenced by Slim\Http\Stream\isSeekable().
|
protected |
Definition at line 80 of file Stream.php.
Referenced by Slim\Http\Stream\getSize().
|
protected |
Definition at line 45 of file Stream.php.
Referenced by Slim\Http\RequestBody\__construct(), Slim\Http\Stream\__construct(), and Slim\Http\Stream\detach().
|
protected |
Definition at line 66 of file Stream.php.
Referenced by Slim\Http\Stream\isWritable().
const Slim\Http\Stream::FSTAT_MODE_S_IFIFO = 0010000 |
Bit mask to determine if the stream is a pipe.
This is octal as per header stat.h
Definition at line 27 of file Stream.php.