You are here

public function vfsStreamWrapper::stream_read in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php \org\bovigo\vfs\vfsStreamWrapper::stream_read()

read the stream up to $count bytes

Parameters

int $count amount of bytes to read:

Return value

string

1 call to vfsStreamWrapper::stream_read()
vfsStreamWrapperRecordingProxy::stream_read in vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/proxy/vfsStreamWrapperRecordingProxy.php
read the stream up to $count bytes
1 method overrides vfsStreamWrapper::stream_read()
vfsStreamWrapperRecordingProxy::stream_read in vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/proxy/vfsStreamWrapperRecordingProxy.php
read the stream up to $count bytes

File

vendor/mikey179/vfsStream/src/main/php/org/bovigo/vfs/vfsStreamWrapper.php, line 425

Class

vfsStreamWrapper
Stream wrapper to mock file system requests.

Namespace

org\bovigo\vfs

Code

public function stream_read($count) {
  if (self::WRITEONLY === $this->mode) {
    return '';
  }
  if ($this->content
    ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()) === false) {
    return '';
  }
  return $this->content
    ->read($count);
}