2017 © Pedro Peláez
 

zippy-extension zippy-ext

The 7-Zip integration for the Zippy.

image

victor78/zippy-ext

The 7-Zip integration for the Zippy.

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 34 % Grown

The README.md

ZippyExt

ZippyExt (aka ZippyExtended) is the libruary extended over Zippy with providing the strategy and the adapter for using 7-Zip, including supporting passwords., (*1)

Installation

The only supported installation method is via Composer. Run the following command to require ZippyExt in your project:, (*2)

composer require victor78/zippy-ext

Adapters

ZippyExt currently supports the following drivers and file formats:, (*3)

  • zip
    • .zip
  • PHP zip extension
    • .zip
  • GNU tar
    • .tar
    • .tar.gz
    • .tar.bz2
  • BSD tar
    • .tar
    • .tar.gz
    • .tar.bz2
  • 7zip, (*4)

    • .zip

    Getting started

All the following code samples assume that ZippyExt is loaded and available as $zippy. You need the following code (or variation of) to load ZippyExt:, (*5)

<?php

use Victor78\ZippyExt\Zippy;

// Require Composer's autoloader
require __DIR__ . '/vendor/autoload.php';

// Load Zippy
$zippy = Zippy::load();

List an archive's contents:

// Open an archive
$archive = $zippy->open('build.tar');

// Iterate through members
foreach ($archive as $member) {
    echo "Archive contains $member" . PHP_EOL;
}

Extract an archive to a specific directory:

// Open an archive
$archive = $zippy->open('build.tar');

// Extract archive contents to `/tmp`
$archive->extract('/tmp');

Create a new archive

// Creates an archive.zip that contains a directory "folder" that contains
// files contained in "/path/to/directory" recursively
$archive = $zippy->create('archive.zip', array(
    'folder' => '/path/to/directory'
), true);

Use 7zip

If you need to use 7zip archiving to create zip archive, you should use fourth parameter:, (*6)

// Creates an archive.zip by 7zip engine
$archive = $zippy->create('archive.zip', $files, true, '7zip');

And if you want to create the encrypted archive, you can use fifth parameter:, (*7)

// Creates an archive.zip with AES-256 encryption and your password 
$archive = $zippy->create('archive.zip', $files, true, '7zip', 'some_your_password');

To extract 7zip with password:, (*8)

//open archive with your password
$archive = $zippy->open('archive.zip', '7zip',  'some_your_password');
$archiveZip->extract('folder_for_extracted');

Documentation

Documentation in English and in Russian here, in wiki., (*9)

License

This project is licensed under the MIT license., (*10)

The Versions

01/05 2018

dev-master

9999999-dev

The 7-Zip integration for the Zippy.

  Sources   Download

MIT

The Requires

 

zip archive archiver zippy 7-zip 7zip archivator

01/05 2018

0.0.4

0.0.4.0

The 7-Zip integration for the Zippy.

  Sources   Download

MIT

The Requires

 

zip archive archiver zippy 7-zip 7zip archivator

21/04 2018

0.0.3

0.0.3.0

The 7-Zip integration for the Zippy.

  Sources   Download

MIT

The Requires

 

zip archive archiver zippy 7-zip 7zip archivator

05/04 2018

0.0.1

0.0.1.0

The 7-Zip integration for the Zippy.

  Sources   Download

MIT

The Requires

 

zip archive archiver zippy 7-zip 7zip archivator