55 }
catch (\Exception $e) {
67 $this->tellPos =
false;
96 public function seek($offset, $whence = SEEK_SET)
98 throw new \RuntimeException(
'Cannot seek a PumpStream');
108 throw new \RuntimeException(
'Cannot write to a PumpStream');
118 $data = $this->buffer->read($length);
119 $readLen = strlen(
$data);
120 $this->tellPos += $readLen;
126 $this->tellPos += strlen(
$data) - $readLen;
135 while (!$this->
eof()) {
148 return isset($this->metadata[
$key]) ? $this->metadata[
$key] :
null;
155 $data = call_user_func($this->source, $length);
157 $this->source =
null;
160 $this->buffer->write(
$data);
161 $length -= strlen(
$data);
162 }
while ($length > 0);
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
An exception for terminatinating execution or to throw for unit testing.
Provides a buffer stream that can be written to to fill a buffer, and read from to remove bytes from ...
Provides a read only stream that pumps data from a PHP callable.
close()
Closes the stream and any underlying resources.
getContents()
Returns the remaining contents in a string.
eof()
Returns true if the stream is at the end of the stream.
getMetadata($key=null)
Get stream metadata as an associative array or retrieve a specific key.
__toString()
Reads all data from the stream into a string, from the beginning to end.
getSize()
Get the size of the stream if known.
__construct(callable $source, array $options=[])
detach()
Separates any underlying resources from the stream.
write($string)
Write data to the stream.
seek($offset, $whence=SEEK_SET)
Seek to a position in the stream.
read($length)
Read data from the stream.
isReadable()
Returns whether or not the stream is readable.
isSeekable()
Returns whether or not the stream is seekable.
rewind()
Seek to the beginning of the stream.
isWritable()
Returns whether or not the stream is writable.
tell()
Returns the current position of the file read/write pointer.
copy_to_string(StreamInterface $stream, $maxLen=-1)
Copy the contents of a stream into a string until the given number of bytes have been read.
if($state['core:TerminatedAssocId'] !==null) $remaining