zip.php holds the zipping function. To use:
$result = zipper ( $_SERVER['DOCUMENT_ROOT'] . '/your/file/path', array ( 'ignore.html' ), 'Zipper.zip', TRUE );
So to use there is just one line to call with a few parameters. In this order:
- Path to the directory - I have put the document root there, just need to assign the exact location of the Directory you want to compress
- Ignore Array - put any files you wish to be ignored and not compressed.
- The Archive name - call this whatever you want and end it in .zip
- Overwrite - Set this to TRUE or FALSE depending if you want to overwrite an existing archive or not.
I provided a /Test directory with some files, which is to demonstrate a folder location - within zip.php there is an example of the function call. Download this exactly, and it should work!
So that's it, you can choose to ignore specific files and just provide a directory to with files in the compress. Quite simple to extend this way and add functionality, but this is the simplest of forms to actually create the ZIP file.
The function returns a BOOLEAN so you can do a condition depending on the call back TRUE/FALSE.