You are here

public function ArchiveTar::_close 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::_close()

Return value

bool

10 calls to ArchiveTar::_close()
ArchiveTar::addString in core/lib/Drupal/Core/Archiver/ArchiveTar.php
This method add a single string as a file at the end of the existing archive. If the archive does not yet exists it is created.
ArchiveTar::createModify in core/lib/Drupal/Core/Archiver/ArchiveTar.php
This method creates the archive file and add the files / directories that are listed in $p_filelist. If the file already exists and is writable, it is replaced by the new tar. It is a create and not an add. If the file exists and is read-only or is a…
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
This method extract from the archive only the files indicated in the $p_filelist. These files are extracted in the current directory or in the directory indicated by the optional $p_path parameter. If indicated the $p_remove_path can be used in the…
ArchiveTar::extractModify in core/lib/Drupal/Core/Archiver/ArchiveTar.php
This method extract all the content of the archive in the directory indicated by $p_path. When relevant the memorized path of the files/dir can be modified by removing the $p_remove_path path at the beginning of the file/dir path. While extracting a…

... See full list

File

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

Class

ArchiveTar

Namespace

Drupal\Core\Archiver

Code

public function _close() {

  //if (isset($this->_file)) {
  if (is_resource($this->_file)) {
    if ($this->_compress_type == 'gz') {
      @gzclose($this->_file);
    }
    else {
      if ($this->_compress_type == 'bz2') {
        @bzclose($this->_file);
      }
      else {
        if ($this->_compress_type == 'lzma2') {
          @xzclose($this->_file);
        }
        else {
          if ($this->_compress_type == 'none') {
            @fclose($this->_file);
          }
          else {
            $this
              ->_error('Unknown or missing compression type (' . $this->_compress_type . ')');
          }
        }
      }
    }
    $this->_file = 0;
  }

  // ----- Look if a local copy need to be erase
  // Note that it might be interesting to keep the url for a time : ToDo
  if ($this->_temp_tarname != '') {
    @drupal_unlink($this->_temp_tarname);
    $this->_temp_tarname = '';
  }
  return true;
}