-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample_usage.php
44 lines (36 loc) · 918 Bytes
/
sample_usage.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/**
* IMPORTANT: require the jczip.class.php
*/
require 'jczip/jczip.class.php';
// increase script timeout value
//ini_set("max_execution_time", 0);
set_time_limit(0);
//instantiate the compressToZip Class
$zip = new compressToZip;
/**
* Define our variables
* Use $sourceToZip = '.'; // Use a dot to zip all files and folders in current directory
* $sourceToZip can be an array of files or folder
*/
//$sourceToZip = array('app','js','skin','var/picaris');
//$destinationOfZip = 'ZIP';
//
//try
//{
// // Process zip
// $zip->createZip( $sourceToZip , $destinationOfZip );
//} catch (Exception $exc)
//{
// echo $exc->getTraceAsString();
//}
$source = array('ZIP/app.zip','ZIP/js.zip','ZIP/skin.zip','ZIP/picaris.zip');
$destination = "UNZIP";
try
{
// Extract zip
$zip->extractZip( $source, $destination );
} catch (Exception $exc)
{
echo $exc->getTraceAsString();
}