diff options
Diffstat (limited to 'ext/zip/examples')
-rw-r--r-- | ext/zip/examples/addglob.php | 14 | ||||
-rw-r--r-- | ext/zip/examples/addpattern.php | 13 |
2 files changed, 27 insertions, 0 deletions
diff --git a/ext/zip/examples/addglob.php b/ext/zip/examples/addglob.php new file mode 100644 index 0000000000..790312b4d5 --- /dev/null +++ b/ext/zip/examples/addglob.php @@ -0,0 +1,14 @@ +<?php + +$z = new ZipArchive; +$z->open('a.zip', ZIPARCHIVE::CREATE); + +/* or 'remove_all_path' => 0*/ +$options = array( + 'remove_path' => '/home/francis/myimages', + 'add_path' => 'images/', +); +$found = $z->addGlob("/home/pierre/cvs/gd/libgd/tests/*.png", 0, $options); +var_dump($found); +$z->close(); + diff --git a/ext/zip/examples/addpattern.php b/ext/zip/examples/addpattern.php new file mode 100644 index 0000000000..a1a9b12291 --- /dev/null +++ b/ext/zip/examples/addpattern.php @@ -0,0 +1,13 @@ +<?php +$z = new ZipArchive; +$z->open('a.zip', ZIPARCHIVE::CREATE); + +/* or 'remove_all_path' => 0*/ +$options = array('remove_path' => '/home/pierre/cvs/gd/libgd/tests', +'add_path' => 'images/', +); + +$found = $z->addPattern("/(\.png)$/i", "/home/pierre/cvs/gd/libgd/tests", $options); +var_dump($found); +$z->close(); + |