1.20.x system.tar.inc private Archive_Tar::_extractInString($p_filename)

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.

Parameters

string $p_filename The path of the file to extract in a string.:

Return value

a string with the file content or null.:

File

modules/system/system.tar.inc, line 1914

Class

Archive_Tar

Code

private function _extractInString($p_filename) 
 {
  $v_result_str = "";

  while (strlen($v_binary_data = $this->_readBlock()) != 0) {
    if (!$this->_readHeader($v_binary_data, $v_header)) {
      return null;
    }

    if ($v_header['filename'] == '') {
      continue;
    }

    switch ($v_header['typeflag']) {
      case 'L':
        {            if (!$this->_readLongHeader($v_header)) {
              return null;
            }        }
    }
    break;

    case 'K':
      {          $v_link_header = $v_header;
          if (!$this->_readLongHeader($v_link_header)) {
            return null;
          }
          $v_header['link'] = $v_link_header['filename'];      }
  }
  break;
}