You are here

function ReadableStreamBackupFile::readBytes in Backup and Migrate 8.4

Read a line from the file.

Parameters

int $size The number of bites to read or 0 to read the whole file:

Return value

string The data read from the file or NULL if the file can't be read or is at the end of the file.

Overrides BackupFileReadableInterface::readBytes

File

lib/backup_migrate_core/src/File/ReadableStreamBackupFile.php, line 124

Class

ReadableStreamBackupFile
Class ReadableStreamBackupFile.

Namespace

BackupMigrate\Core\File

Code

function readBytes($size = 1024, $binary = FALSE) {
  if (!$this
    ->isOpen()) {
    $this
      ->openForRead($binary);
  }
  if ($this->handle && !feof($this->handle)) {
    return fread($this->handle, $size);
  }
  return NULL;
}