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
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
string
|
|
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
|
|
public static
|
#
numberDecode( string $field )
Decodes numeric values according to the https://www.gnu.org/software/tar/manual/html_node/Extensions.html#Extensions (basically with support for big numbers) |
public static
string
|
#
numberEncode( integer $value, integer $length )
Encodes numeric values according to the https://www.gnu.org/software/tar/manual/html_node/Extensions.html#Extensions (basically with support for big numbers) |
setCallback()
|
integer |
READ_CHUNK_SIZE
|
#
1048576
|
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
|
protected
integer
|
$position
|
#
0
|
protected
integer
|
$contentUntil
|
#
0
|
protected
integer
|
$skipUntil
|
#
0
|
$callback
|