Lines Matching refs:zip
5 if(!extension_loaded('zip')) die('skip');
11 $file = $dirname . '__tmp_oo_set_comment.zip';
15 $zip = new ZipArchive;
16 if (!$zip->open($file, ZIPARCHIVE::CREATE)) {
20 $zip->addFromString('entry1.txt', 'entry #1');
21 $zip->addFromString('entry2.txt', 'entry #2');
22 $zip->addFromString('dir/entry2d.txt', 'entry #2');
23 $zip->addFromString('entry4.txt', 'entry #1');
24 $zip->addFromString('entry5.txt', 'entry #2');
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->setCommentIndex(3, 'entry4.txt'));
33 var_dump($zip->setCommentIndex(4, 'entry5.txt'));
34 var_dump($zip->setArchiveComment('archive'));
36 if (!$zip->status == ZIPARCHIVE::ER_OK) {
37 echo "failed to write zip\n";
39 $zip->close();
41 if (!$zip->open($file)) {
46 var_dump($zip->getCommentIndex(0));
47 var_dump($zip->getCommentIndex(1));
48 var_dump($zip->getCommentIndex(2));
49 var_dump($zip->getCommentIndex(3));
50 var_dump($zip->getCommentIndex(4));
51 var_dump($zip->getArchiveComment());
53 $zip->close();