Lines Matching refs:zip
4 zip
9 $file = $dirname . 'oo_setcomment.zip';
13 $zip = new ZipArchive;
14 if (!$zip->open($file, ZIPARCHIVE::CREATE)) {
18 $zip->addFromString('entry1.txt', 'entry #1');
19 $zip->addFromString('entry2.txt', 'entry #2');
20 $zip->addFromString('dir/entry2d.txt', 'entry #2');
21 $zip->addFromString('entry4.txt', 'entry #1');
22 var_dump($zip->setCommentIndex($zip->lastId, 'entry4.txt'));
23 $zip->addFromString('entry5.txt', 'entry #2');
24 var_dump($zip->setCommentIndex($zip->lastId, 'entry5.txt'));
27 var_dump($zip->setCommentName('entry1.txt', 'entry1.txt'));
28 var_dump($zip->setCommentName('entry2.txt', 'entry2.txt'));
29 var_dump($zip->setCommentName('dir/entry2d.txt', 'dir/entry2d.txt'));
30 var_dump($zip->setArchiveComment('archive'));
32 var_dump($zip->setArchiveComment('archive'));
34 if (!$zip->status == ZIPARCHIVE::ER_OK) {
35 echo "failed to write zip\n";
37 $zip->close();
39 if (!$zip->open($file)) {
44 var_dump($zip->getCommentIndex(0));
45 var_dump($zip->getCommentIndex(1));
46 var_dump($zip->getCommentIndex(2));
47 var_dump($zip->getCommentIndex(3));
48 var_dump($zip->getCommentIndex(4));
49 var_dump($zip->getArchiveComment());
51 $zip->close();