コード例 #1
0
ファイル: Base.php プロジェクト: shabbyrobe/defile
 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;
 }
コード例 #2
0
ファイル: LocalFile.php プロジェクト: shabbyrobe/defile
 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;
 }