Home « Server software «
Documentation: included/tar.php
included/tar.php
This script is a reference file of this system.
Licence: http://www.php.net/license/3_0.txt
Auteurs:
- Vincent Blavet
class Archive_Tar - Creates a (compressed) Tar archive
@version $Revision: 1.29 $ @package ArchiveAuteurs:
- Vincent Blavet
included/tar.php - @var string Name of the Tar
included/tar.php - @var boolean if true, the Tar file will be gzipped
included/tar.php - @var string Type of compression : 'none', 'gz' or 'bz2'
included/tar.php - @var string Explode separator
included/tar.php - @var file descriptor
included/tar.php - @var string Local Tar name of a remote Tar (http:// or ftp://)
Archive_Tar() - Archive_Tar Class constructor. This flavour of the constructor only
function Archive_Tar($p_tarname, $p_compress = null)
- $p_tarname - string $p_tarname The name of the tar archive to create
- $p_compress = null - string $p_compress can be null, 'gz' or 'bz2'. This
parameter indicates if gzip or bz2 compression is required. For compatibility reason the boolean value 'true' means 'gz'. @access public
_Archive_Tar()
function _Archive_Tar()
create() - This method creates the archive file and add the files / directories
function create($p_filelist)
- $p_filelist - array $p_filelist An array of filenames and directory names, or a
- returns true on success, false on error.
single string with names separated by a single blank space. @access public
Voir aussi:
add() - This method add the files / directories that are listed in $p_filelist in
function add($p_filelist)
- $p_filelist - array $p_filelist An array of filenames and directory names, or a
- returns true on success, false on error.
single string with names separated by a single blank space. @access public
Voir aussi:
extract()
function extract($p_path='')
- $p_path='' -
listContent()
function listContent()
createModify() - This method creates the archive file and add the files / directories
function createModify($p_filelist, $p_add_dir, $p_remove_dir='')
- $p_filelist - array $p_filelist An array of filenames and directory names,
- $p_add_dir - string $p_add_dir A string which contains a path to be added
- $p_remove_dir='' - string $p_remove_dir A string which contains a path to be
- returns boolean true on success, false on error.
or a single string with names separated by a single blank space. to the memorized path of each element in the list. removed from the memorized path of each element in the list, when relevant. @access public
Voir aussi:
addModify() - This method add the files / directories listed in $p_filelist at the
function addModify($p_filelist, $p_add_dir, $p_remove_dir='')
- $p_filelist - array $p_filelist An array of filenames and directory
- $p_add_dir - string $p_add_dir A string which contains a path to be
- $p_remove_dir='' - string $p_remove_dir A string which contains a path to be
- returns true on success, false on error.
names, or a single string with names separated by a single blank space. added to the memorized path of each element in the list. removed from the memorized path of each element in the list, when relevant. @access public
addString() - This method add a single string as a file at the
function addString($p_filename, $p_string)
- $p_filename - string $p_filename A string which contains the full
- $p_string - string $p_string The content of the file added in
- returns true on success, false on error.
filename path that will be associated with the string. the archive. @access public
extractModify() - This method extract all the content of the archive in the directory
function extractModify($p_path, $p_remove_path)
- $p_path - string $p_path The path of the directory where the
- $p_remove_path - string $p_remove_path Part of the memorized path that can be
- returns boolean true on success, false on error.
files/dir need to by extracted. removed if present at the beginning of the file/dir path. @access public
Voir aussi:
extractInString() - This method extract from the archive one file identified by $p_filename.
function extractInString($p_filename)
- $p_filename - string $p_filename The path of the file to extract in a string.
- returns a string with the file content or NULL.
extractList() - This method extract from the archive only the files indicated in the
function extractList($p_filelist, $p_path='', $p_remove_path='')
- $p_filelist - array $p_filelist An array of filenames and directory names,
- $p_path='' - string $p_path The path of the directory where the
- $p_remove_path='' - string $p_remove_path Part of the memorized path that can be
- returns true on success, false on error.
Voir aussi:
setAttribute() - This method set specific attributes of the archive. It uses a variable
function setAttribute()
- returns true on success, false on error.
_error()
function _error($p_message)
- $p_message -
_warning()
function _warning($p_message)
- $p_message -
_isArchive()
function _isArchive($p_filename=NULL)
- $p_filename=NULL -
_openWrite()
function _openWrite()
_openRead()
function _openRead()
_openReadWrite()
function _openReadWrite()
_close()
function _close()
_cleanFile()
function _cleanFile()
_writeBlock()
function _writeBlock($p_binary_data, $p_len=null)
- $p_binary_data -
- $p_len=null -
_readBlock()
function _readBlock()
_jumpBlock()
function _jumpBlock($p_len=null)
- $p_len=null -
_writeFooter()
function _writeFooter()
_addList()
function _addList($p_list, $p_add_dir, $p_remove_dir)
- $p_list -
- $p_add_dir -
- $p_remove_dir -
_addFile()
function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir)
- $p_filename -
- &$p_header -
- $p_add_dir -
- $p_remove_dir -
_addString()
function _addString($p_filename, $p_string)
- $p_filename -
- $p_string -
_writeHeader()
function _writeHeader($p_filename, $p_stored_filename)
- $p_filename -
- $p_stored_filename -
_writeLongHeader()
function _writeLongHeader($p_filename)
- $p_filename -
_readHeader()
function _readHeader($v_binary_data, &$v_header)
- $v_binary_data -
- &$v_header -
_readLongHeader()
function _readLongHeader(&$v_header)
- &$v_header -
_extractInString() - This method extract from the archive one file identified by $p_filename.
function _extractInString($p_filename)
- $p_filename - string $p_filename The path of the file to extract in a string.
- returns a string with the file content or NULL.
_openAppend()
function _openAppend()
_append()
function _append($p_filelist, $p_add_dir='', $p_remove_dir='')
- $p_filelist -
- $p_add_dir='' -
- $p_remove_dir='' -
_dirCheck() - Check if a directory exists and create it (including parent
function _dirCheck($p_dir)
- $p_dir - string $p_dir directory to check
- returns bool TRUE if the directory exists or was created
_pathReduction() - Compress path by changing for example "/dir/foo/../bar" to "/dir/bar",
function _pathReduction($p_dir)
- $p_dir - string $p_dir path to reduce
- returns string reduced path
@access private
_translateWinPath()
function _translateWinPath($p_path, $p_remove_disk_letter=true)
- $p_path -
- $p_remove_disk_letter=true -