X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fzendframework%2Fzend-diactoros%2Fsrc%2FPhpInputStream.php;fp=vendor%2Fzendframework%2Fzend-diactoros%2Fsrc%2FPhpInputStream.php;h=58bd1e4729284aca1244644fad1c3722f5b5e228;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/zendframework/zend-diactoros/src/PhpInputStream.php b/vendor/zendframework/zend-diactoros/src/PhpInputStream.php new file mode 100644 index 000000000..58bd1e472 --- /dev/null +++ b/vendor/zendframework/zend-diactoros/src/PhpInputStream.php @@ -0,0 +1,91 @@ +reachedEof) { + return $this->cache; + } + + $this->getContents(); + return $this->cache; + } + + /** + * {@inheritdoc} + */ + public function isWritable() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function read($length) + { + $content = parent::read($length); + if ($content && ! $this->reachedEof) { + $this->cache .= $content; + } + + if ($this->eof()) { + $this->reachedEof = true; + } + + return $content; + } + + /** + * {@inheritdoc} + */ + public function getContents($maxLength = -1) + { + if ($this->reachedEof) { + return $this->cache; + } + + $contents = stream_get_contents($this->resource, $maxLength); + $this->cache .= $contents; + + if ($maxLength === -1 || $this->eof()) { + $this->reachedEof = true; + } + + return $contents; + } +}