class compress

Class for handling archives (compression/decompression)

Properties

$fp
protected array $filelist

Methods

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

Add file to archive

add_custom_file($src, $filename)

Add custom file (the filepath will not be adjusted)

add_data($src, $name)

Add file data

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.

static array
methods()

Return available methods

Details

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

at line 107
add_custom_file($src, $filename)

Add custom file (the filepath will not be adjusted)

Parameters

$src
$filename

at line 121
add_data($src, $name)

Add file data

Parameters

$src
$name

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

at line 167
static array methods()

Return available methods

Return Value

array

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