aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpabs <pabs@vault.home.pablotron.org>2007-08-23 03:52:30 -0400
committerpabs <pabs@vault.home.pablotron.org>2007-08-23 03:52:30 -0400
commit2a4160e670f476cb797a812429ef622e8009343c (patch)
treee7040733108386cd516ff97d6f33953deb7b4994
parentab07bb311ae7f8781da42ee79d1e441718521a5e (diff)
downloadzipstream-php-2a4160e670f476cb797a812429ef622e8009343c.tar.bz2
zipstream-php-2a4160e670f476cb797a812429ef622e8009343c.zip
Updated test/index.php.
-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();