function ArchiveTar::_writeBlock

7 calls to ArchiveTar::_writeBlock()
ArchiveTar::_addFile in drupal/core/lib/Drupal/Component/Archiver/ArchiveTar.php
ArchiveTar::_addString in drupal/core/lib/Drupal/Component/Archiver/ArchiveTar.php
ArchiveTar::_openAppend in drupal/core/lib/Drupal/Component/Archiver/ArchiveTar.php
ArchiveTar::_writeFooter in drupal/core/lib/Drupal/Component/Archiver/ArchiveTar.php
ArchiveTar::_writeHeader in drupal/core/lib/Drupal/Component/Archiver/ArchiveTar.php

... See full list

File

drupal/core/lib/Drupal/Component/Archiver/ArchiveTar.php, line 813

Class

ArchiveTar
Creates a (compressed) Tar archive

Namespace

Drupal\Component\Archiver

Code

function _writeBlock($p_binary_data, $p_len = null) {
  if (is_resource($this->_file)) {
    if ($p_len === null) {
      if ($this->_compress_type == 'gz') {
        @gzputs($this->_file, $p_binary_data);
      }
      else {
        if ($this->_compress_type == 'bz2') {
          @bzwrite($this->_file, $p_binary_data);
        }
        else {
          if ($this->_compress_type == 'none') {
            @fputs($this->_file, $p_binary_data);
          }
          else {
            $this
              ->_error('Unknown or missing compression type (' . $this->_compress_type . ')');
          }
        }
      }
    }
    else {
      if ($this->_compress_type == 'gz') {
        @gzputs($this->_file, $p_binary_data, $p_len);
      }
      else {
        if ($this->_compress_type == 'bz2') {
          @bzwrite($this->_file, $p_binary_data, $p_len);
        }
        else {
          if ($this->_compress_type == 'none') {
            @fputs($this->_file, $p_binary_data, $p_len);
          }
          else {
            $this
              ->_error('Unknown or missing compression type (' . $this->_compress_type . ')');
          }
        }
      }
    }
  }
  return true;
}