linkus/php-archive

There is no license information available for the latest version (1.2.1) of this package.

Extract archive from multiple format

This package's canonical repository appears to be gone and the package has been frozen as a result.

1.2.1 2018-10-05 02:15 UTC

This package is not auto-updated.

Last update: 2023-01-11 22:20:34 UTC


README

Managing archives of different format with a unified interface

Usage

Open an archive:

$arch = new ArchiveManager();
$arch->open('path/to/archive');

Extracting files:

// some files:
$arch->extract('path/to/extract', 'file1.txt');

$arch->extract('path/to/extract', ['file1.txt', 'file2.txt']);

// extract all files:
$arch->extractAll('path/to/extract');

Archiving files:

// create a new archive from source:
$arch->compress('path/to/directory', 'path/to/archive');

Note: extension of the archive name while determines the archive format.

Adding files:

$arch->add('path/to/file', 'filename');

Test archive integrity:

$arch->test('path/to/file');