PHP Class Prado\IO\TTarFileExtractor

Since: 3.0
Author: Vincent Blavet ([email protected])
Exibir arquivo Open project: pradosoft/prado Class Usage Examples

Public Methods

Method Description
__construct ( string $p_tarname ) Archive_Tar Class constructor. This flavour of the constructor only declare a new Archive_Tar object, identifying it by the name of the tar file.
__destruct ( )
extract ( $p_path = '' )

Protected Methods

Method Description
_dirCheck ( string $p_dir ) : boolean Check if a directory exists and create it (including parent dirs) if not.
_error ( $p_message )
_extractList ( $p_path, &$p_list_detail, $p_mode, $p_file_list, $p_remove_path )
_translateWinPath ( $p_path, $p_remove_disk_letter = true )
extractModify ( string $p_path, string $p_remove_path ) : boolean 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.

Private Methods

Method Description
_cleanFile ( )
_close ( )
_isArchive ( $p_filename = null )
_jumpBlock ( $p_len = null )
_openRead ( )
_readBlock ( )
_readHeader ( $v_binary_data, &$v_header )
_readLongHeader ( &$v_header )

Method Details

__construct() public method

Archive_Tar Class constructor. This flavour of the constructor only declare a new Archive_Tar object, identifying it by the name of the tar file.
public __construct ( string $p_tarname )
$p_tarname string The name of the tar archive to create

__destruct() public method

public __destruct ( )

_dirCheck() protected method

Check if a directory exists and create it (including parent dirs) if not.
protected _dirCheck ( string $p_dir ) : boolean
$p_dir string directory to check
return boolean true if the directory exists or was created

_error() protected method

protected _error ( $p_message )

_extractList() protected method

protected _extractList ( $p_path, &$p_list_detail, $p_mode, $p_file_list, $p_remove_path )

_translateWinPath() protected method

protected _translateWinPath ( $p_path, $p_remove_disk_letter = true )

extract() public method

public extract ( $p_path = '' )

extractModify() protected method

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.
protected extractModify ( string $p_path, string $p_remove_path ) : boolean
$p_path string The path of the directory where the files/dir need to by extracted.
$p_remove_path string Part of the memorized path that can be removed if present at the beginning of the file/dir path.
return boolean true on success, false on error.