2017 © Pedro Peláez
 

library unix-zipper

A simple compression package for Unix operating systems. UnixZipper is ideal for creating backups of your projects in unix servers.

image

dimsav/unix-zipper

A simple compression package for Unix operating systems. UnixZipper is ideal for creating backups of your projects in unix servers.

  • Saturday, January 18, 2014
  • by dimsav
  • Repository
  • 1 Watchers
  • 2 Stars
  • 414 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

UnixZipper

Latest Stable Version Build Status, (*1)

A simple zip compression library for Unix operating systems. UnixZipper is ideal for creating backups of your projects in unix servers., (*2)

Features

  1. Easy to use
  2. Password protection
  3. Tested for stability

How does it work

Here is a simple example. Feel free to check the tests to see the class in action., (*3)

// Instantiate the class
$zipper = new UnixZipper();

// Add absolute paths of directories or files for compression
$zipper->add('/absolute/path/to/some/directory');
$zipper->add('/absolute/path/to/file.txt');

// Exclude directories and files
$zipper->exclude('/absolute/path/to/some/directory');
$zipper->exclude('/absolute/path/to/some/file.txt');

// Add a password if you wish
$zipper->setPassword('my_password');

// The path of the file that will be generated
// If the given path doesn't exist, it will be created automatically.
$zipper->setDestination('/file/after/compression/test.zip');

// Do the magic
$zipper->compress();

Since version 1.2, you can set a base path, and provide the files to be compressed relatively., (*4)

$zipper = new UnixZipper();

// Set base path
$zipper->setAbsolutePathAsBase('/absolute/projects');

// Add relative paths of directories or files for compression
$zipper->add('project-1');     // /absolute/projects/project-1
$zipper->add('logs/file.txt'); // /absolute/projects/logs/file.txt

$zipper->setDestination('/file/after/compression/test.zip');

// Compress
$zipper->compress();

Why unix

The reason I chose to make this package unix-only is because I wanted to rely on the system's zip function, that offers stability and flexibility. It also offers the possibility to exclude directories recursively, a feature I couldn't find in other php classes., (*5)

Installation

Install using composer:, (*6)

  1. Add "dimsav/unix-zipper": "1.*" to your composer.json file
  2. Run composer update

Dependencies

The only requirements are: * executing the code on a unix system * composer for installing/autoloading, (*7)

The Versions

18/01 2014

dev-master

9999999-dev http://github.com/dimsav/unix-zipper

A simple compression package for Unix operating systems. UnixZipper is ideal for creating backups of your projects in unix servers.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

zip compress zipper

18/01 2014

v1.2

1.2.0.0 http://github.com/dimsav/unix-zipper

A simple compression package for Unix operating systems. UnixZipper is ideal for creating backups of your projects in unix servers.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

zip compress zipper

18/01 2014

dev-develop

dev-develop http://github.com/dimsav/unix-zipper

A simple compression package for Unix operating systems. UnixZipper is ideal for creating backups of your projects in unix servers.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

zip compress zipper

23/12 2013

v1.1

1.1.0.0 http://github.com/dimsav/unix-zipper

A simple compression package for Unix operating systems. UnixZipper is ideal for creating backups of your projects in unix servers.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

zip compress zipper

15/09 2013

v1.0.3

1.0.3.0 http://github.com/dimsav/unix-zipper

A simple compression package for Unix operating systems. UnixZipper is ideal for creating backups of your projects in unix servers.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

zip compress zipper

15/09 2013

v1.0.2

1.0.2.0 http://github.com/dimsav/unix-zipper

A simple compression package for Unix operating systems. UnixZipper is ideal for creating backups of your projects in unix servers.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

zip compress zipper

11/09 2013

v1.0

1.0.0.0 http://github.com/dimsav/unix-zipper

A simple compression package for Unix operating systems. UnixZipper is ideal for creating backups of your projects in unix servers.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

zip compress zipper