function Archive_Tar::extractList

7.x system.tar.inc Archive_Tar::extractList($p_filelist, $p_path = '', $p_remove_path = '')

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.

@access public

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.

Return value

true on success, false on error.

See also

extractModify()

File

drupal-7.x/modules/system/system.tar.inc, line 552

Class

Archive_Tar
Creates a (compressed) Tar archive *

Code

function extractList($p_filelist, $p_path = '', $p_remove_path = '') 
 {
  $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);
    $this->_close();
  }

  return $v_result;
}