1 system.tar.inc public Archive_Tar::extractList($p_filelist, $p_path = '', $p_remove_path = '', $p_preserve = false, $p_symlinks = true)

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 same way as it is used in extractModify() method.

Parameters

array $p_filelist An array of filenames and directory names,: or a single string with names separated by a single blank space.

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:

boolean $p_symlinks Allow symlinks.:

Return value

bool true on success, false on error.:

See also

extractModify()

File

core/modules/system/system.tar.inc, line 691

Class

Archive_Tar

Code

public function extractList($p_filelist, $p_path = '', $p_remove_path = '', $p_preserve = false, $p_symlinks = true) 
 {
  $v_result = true;
  $v_list_detail = array();

  if (is_array($p_filelist)) {
    $v_list = $p_filelist;
  }
  elseif (is_string($p_filelist)) {
    $v_list = explode($this->_separator, $p_filelist);
  }
  else {
    $this->_error('Invalid string list');
    return false;
  }

  if ($v_result = $this->_openRead()) {
    $v_result = $this->_extractList(
    $p_path, 
    $v_list_detail, 
    "partial", 
    $v_list, 
    $p_remove_path, 
    $p_preserve, 
    $p_symlinks
    );
    $this->_close();
  }

  return $v_result;
}