Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml


Classes:
Keyword

Class TTarFileExtractor


TTarFileExtractor class

Since: 3.0
Author: Vincent Blavet <vincent@phpconcept.net>

Constructor Summary
public
__construct Array
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.

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

Constructor Details

__construct

public __construct Array

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.


Method Details

extract

public void extract (mixed $p_path )

Input
mixed$p_path
Output
Exception

extractModify

protected boolean extractModify (string $p_path , string $p_remove_path )

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.

Input
string$p_pathThe path of the directory where the files/dir need to by extracted.
string$p_remove_pathPart of the memorized path that can be removed if present at the beginning of the file/dir path.
Output
boolean true on success, false on error.
Exception

_dirCheck

protected bool _dirCheck (string $p_dir )

Check if a directory exists and create it (including parent dirs) if not.

Input
string$p_dirdirectory to check
Output
bool true if the directory exists or was created
Exception

_error

protected void _error (mixed $p_message )

Input
mixed$p_message
Output
Exception

_extractList

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

Input
mixed$p_path
mixed&$p_list_detail
mixed$p_mode
mixed$p_file_list
mixed$p_remove_path
Output
Exception

_translateWinPath

protected void _translateWinPath (mixed $p_path , mixed $p_remove_disk_letter )

Input
mixed$p_path
mixed$p_remove_disk_letter
Output
Exception