You are here

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

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 file, if the directory path does not exists it is created. While extracting a file, if the file already exists it is replaced without looking for last modification date. While extracting a file, if the file already exists and is write protected, the extraction is aborted. While extracting a file, if a directory with the same name already exists, the extraction is aborted. While extracting a directory, if a file with the same name already exists, the extraction is aborted. While extracting a file/directory if the destination directory exist and is write protected, or does not exist but can not be created, the extraction is aborted. If after extraction an extracted file does not show the correct stored file size, the extraction is aborted. When the extraction is aborted, a PEAR error text is set and false is returned. However the result can be a partial extraction that may need to be manually cleaned.

Parameters

string $p_path The path of the directory where the: files/dir need to by extracted.

string $p_remove_path Part of the memorized path that can be: removed if present at the beginning of the file/dir path.

boolean $p_preserve Preserve user/group ownership of files:

Return value

boolean true on success, false on error.

See also

extractList()

1 call to ArchiveTar::extractModify()
ArchiveTar::extract in core/lib/Drupal/Core/Archiver/ArchiveTar.php

File

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

Class

ArchiveTar

Namespace

Drupal\Core\Archiver

Code

public function extractModify($p_path, $p_remove_path, $p_preserve = false) {
  $v_result = true;
  $v_list_detail = array();
  if ($v_result = $this
    ->_openRead()) {
    $v_result = $this
      ->_extractList($p_path, $v_list_detail, "complete", 0, $p_remove_path, $p_preserve);
    $this
      ->_close();
  }
  return $v_result;
}