public function read($length = null) { if (!($this->mode & Stream::READ)) { throw FileException::ENOTREADABLE(); } list($buf, $bytesRead) = $this->doRead($length); if ($length === null || $bytesRead != $length) { $this->eof = true; } return $buf; }
function read($length = null) { if (!($this->streamMode & Stream::READ)) { throw FileException::ENOTREADABLE(); } if ($length === null) { $buf = stream_get_contents($this->handle); } else { $buf = fread($this->handle, $length); } return $buf; }