diff options
author | pabs <pabs@vault.home.pablotron.org> | 2007-08-23 03:52:30 -0400 |
---|---|---|
committer | pabs <pabs@vault.home.pablotron.org> | 2007-08-23 03:52:30 -0400 |
commit | 2a4160e670f476cb797a812429ef622e8009343c (patch) | |
tree | e7040733108386cd516ff97d6f33953deb7b4994 | |
parent | ab07bb311ae7f8781da42ee79d1e441718521a5e (diff) | |
download | zipstream-php-2a4160e670f476cb797a812429ef622e8009343c.tar.bz2 zipstream-php-2a4160e670f476cb797a812429ef622e8009343c.zip |
Updated test/index.php.
-rw-r--r-- | test/index.php | 24 |
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(); |