aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/index.php24
1 files changed, 18 insertions, 6 deletions
diff --git a/test/index.php b/test/index.php
index 3eb4769..33e2fc5 100644
--- a/test/index.php
+++ b/test/index.php
@@ -1,18 +1,30 @@
<?php
+# load zipstream class
require '../zipstream.php';
+# add some random files
$files = array(
- '/home/pabs/pablotron/files/url_scripts-0.1.0.tar.gz',
- '/home/pabs/pablotron/files/url_scripts-0.1.1.tar.gz',
- '/home/pabs/pablotron/files/url_scripts-0.1.2.tar.gz',
- '/home/pabs/pablotron/files/url_scripts-0.1.3.tar.gz',
+ '/store/dl/wurfl.xml.gz',
+ '/store/dl/hugh_hefner_interview.html',
);
-$zip = new ZipStream('url_scripts.zip', true);
+$zip = new ZipStream('test.zip', array(
+ 'comment' => 'this is a zip file comment. hello?'
+));
+$file_opt = array(
+ 'time' => time() - 2 * 3600,
+ 'comment' => 'this is a file comment. hi!',
+);
+
+# add files under folder 'asdf'
+foreach ($files as $file)
+ $zip->add_file('asdf/' . basename($file), file_get_contents($file), $file_opt);
+
+# add same files again wihtout a folder
foreach ($files as $file)
- $zip->add_file(basename($file), file_get_contents($file));
+ $zip->add_file(basename($file), file_get_contents($file), $file_opt);
$zip->finish();