class compress_tar extends compress

Tar/tar.gz compression routine Header/checksum creation derived from tarfile.pl, (c) Tom Horsley, 1994

Properties

$fp from  compress
protected array $filelist from  compress
$isgz
$isbz
$filename
$mode
$type
$wrote
protected filesystem_interface $filesystem

Methods

add_file($src, $src_rm_prefix = '', $src_add_prefix = '', $skip_files = '')

Add file to archive

from  compress
add_custom_file($src, $filename)

Add custom file (the filepath will not be adjusted)

from  compress
add_data($src, $name)

Add file data

from  compress
string
unique_filename(string $name)

Checks if a file by that name as already been added and, if it has, returns a new, unique name.

from  compress
static array
methods()

Return available methods

from  compress
__construct($mode, $file, $type = '')

Constructor

extract($dst)

Extract archive

close()

Close archive

data($name, $data, $stat, $is_dir = false)

Create the structures

open()

Open archive

download($filename, $download_name = false)

Download archive

Details

in compress at line 37
add_file($src, $src_rm_prefix = '', $src_add_prefix = '', $skip_files = '')

Add file to archive

Parameters

$src
$src_rm_prefix
$src_add_prefix
$skip_files

in compress at line 107
add_custom_file($src, $filename)

Add custom file (the filepath will not be adjusted)

Parameters

$src
$filename

in compress at line 121
add_data($src, $name)

Add file data

Parameters

$src
$name

in compress at line 139
protected string unique_filename(string $name)

Checks if a file by that name as already been added and, if it has, returns a new, unique name.

Parameters

string $name

The filename

Return Value

string

A unique filename

in compress at line 167
static array methods()

Return available methods

Return Value

array

Array of strings of available compression methods (.tar, .tar.gz, .zip, etc.)

at line 572
__construct($mode, $file, $type = '')

Constructor

Parameters

$mode
$file
$type

at line 591
extract($dst)

Extract archive

Parameters

$dst

at line 709
close()

Close archive

at line 727
data($name, $data, $stat, $is_dir = false)

Create the structures

Parameters

$name
$data
$stat
$is_dir

at line 774
open()

Open archive

at line 788
download($filename, $download_name = false)

Download archive

Parameters

$filename
$download_name