class compress_zip extends compress

Zip creation class from phpMyAdmin 2.3.0 (c) Tobias Ratschiller, Olivier Müller, Loïc Chapeaux, Marc Delisle, http://www.phpmyadmin.net/

Zip extraction function by Alexandre Tedeschi, alexandrebr at gmail dot com

Modified extensively by psoTFX and DavidMJ, (c) phpBB Limited, 2003

Based on work by Eric Mueller and Denis125 Official ZIP file format: http://www.pkware.com/appnote.txt

Properties

$fp from  compress
protected array $filelist from  compress
$datasec
$ctrl_dir
$eof_cdh
$old_offset
$datasec_len
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)

Constructor

unix_to_dos_time($time)

Convert unix to dos time

extract($dst)

Extract archive

close()

Close archive

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

Create the structures ... note we assume version made by is MSDOS

file()

file

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 213
__construct($mode, $file)

Constructor

Parameters

$mode
$file

at line 229
unix_to_dos_time($time)

Convert unix to dos time

Parameters

$time

at line 246
extract($dst)

Extract archive

Parameters

$dst

at line 409
close()

Close archive

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

Create the structures ... note we assume version made by is MSDOS

Parameters

$name
$data
$stat
$is_dir

at line 509
file()

file

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

Download archive

Parameters

$filename
$download_name