Class Tar
Class Tar
Creates or extracts Tar archives. Supports gz and bzip compression
Long pathnames (>100 chars) are supported in POSIX ustar and GNU longlink formats.
- splitbrain\PHPArchive\Archive
- splitbrain\PHPArchive\Tar
Namespace: splitbrain\PHPArchive
Package: splitbrain\PHPArchive
License: MIT
Author: Andreas Gohr andi@splitbrain.org
Located at Tar.php
Package: splitbrain\PHPArchive
License: MIT
Author: Andreas Gohr andi@splitbrain.org
Located at Tar.php
public
|
#
setCompression( integer $level = 9, integer $type = Archive::COMPRESS_AUTO )
Sets the compression to use |
public
|
|
public
|
|
public
|
#
yieldContents( )
Read the contents of a TAR archive and return each entry using yield for memory efficiency. |
public
|
|
public
|
|
public
|
#
addFile( string $file, string|
Add a file to the current TAR archive using an existing file in the filesystem |
public
|
#
addData( string|
Add a file to the current TAR archive using the given $data as content |
public
|
|
public
|
|
public
|
|
protected
string
|
|
protected
integer
|
|
protected
|
|
protected
|
#
writeFileHeader(
Write the given file meta data as header |
protected
|
#
writeRawFileHeader( string $name, integer $uid, integer $gid, integer $perm, integer $size, integer $mtime, string $typeflag = '' )
Write a file header to the stream |
protected
array|false
|
|
protected
|
|
protected
|
#
compressioncheck( $comptype )
Checks if the given compression type is available and throws an exception if not |
public
integer
|
setCallback()
|
COMPRESS_AUTO,
COMPRESS_BZIP,
COMPRESS_GZIP,
COMPRESS_NONE
|
protected
string
|
$file
|
#
''
|
protected
integer
|
$comptype
|
#
Archive::COMPRESS_AUTO
|
protected
integer
|
$complevel
|
#
9
|
protected
|
$fh
|
|
protected
string
|
$memory
|
#
''
|
protected
boolean
|
$closed
|
#
true
|
protected
boolean
|
$writeaccess
|
#
false
|
$callback
|