You are here

public function ArchiveTar::_readBlock in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Archiver/ArchiveTar.php \Drupal\Core\Archiver\ArchiveTar::_readBlock()

Return value

null|string

4 calls to ArchiveTar::_readBlock()
ArchiveTar::_extractInString in core/lib/Drupal/Core/Archiver/ArchiveTar.php
This method extract from the archive one file identified by $p_filename. The return value is a string with the file content, or null on error.
ArchiveTar::_extractList in core/lib/Drupal/Core/Archiver/ArchiveTar.php
ArchiveTar::_jumpBlock in core/lib/Drupal/Core/Archiver/ArchiveTar.php
ArchiveTar::_readLongHeader in core/lib/Drupal/Core/Archiver/ArchiveTar.php

File

core/lib/Drupal/Core/Archiver/ArchiveTar.php, line 1084

Class

ArchiveTar

Namespace

Drupal\Core\Archiver

Code

public function _readBlock() {
  $v_block = null;
  if (is_resource($this->_file)) {
    if ($this->_compress_type == 'gz') {
      $v_block = @gzread($this->_file, 512);
    }
    else {
      if ($this->_compress_type == 'bz2') {
        $v_block = @bzread($this->_file, 512);
      }
      else {
        if ($this->_compress_type == 'lzma2') {
          $v_block = @xzread($this->_file, 512);
        }
        else {
          if ($this->_compress_type == 'none') {
            $v_block = @fread($this->_file, 512);
          }
          else {
            $this
              ->_error('Unknown or missing compression type (' . $this->_compress_type . ')');
          }
        }
      }
    }
  }
  return $v_block;
}