Lines Matching refs:zip
6 if(!extension_loaded('zip')) die('skip');
12 $file = $dirname . '__tmp_oo_set_comment.zip';
16 $zip = new ZipArchive;
17 if (!$zip->open($file, ZIPARCHIVE::CREATE)) {
21 $zip->addFromString('entry1.txt', 'entry #1');
22 $zip->addFromString('entry2.txt', 'entry #2');
23 $zip->addFromString('dir/entry2d.txt', 'entry #2');
24 $zip->addFromString('entry4.txt', 'entry #1');
25 $zip->addFromString('entry5.txt', 'entry #2');
28 var_dump($zip->setCommentName('entry1.txt', 'entry1.txt'));
29 var_dump($zip->setCommentName('entry2.txt', 'entry2.txt'));
30 var_dump($zip->setCommentName('dir/entry2d.txt', 'dir/entry2d.txt'));
31 var_dump($zip->setArchiveComment('archive'));
33 var_dump($zip->setCommentIndex(3, 'entry4.txt'));
34 var_dump($zip->setCommentIndex(4, 'entry5.txt'));
35 var_dump($zip->setArchiveComment('archive'));
37 if (!$zip->status == ZIPARCHIVE::ER_OK) {
38 echo "failed to write zip\n";
40 $zip->close();
42 if (!$zip->open($file)) {
47 var_dump($zip->getCommentIndex(0));
48 var_dump($zip->getCommentIndex(1));
49 var_dump($zip->getCommentIndex(2));
50 var_dump($zip->getCommentIndex(3));
51 var_dump($zip->getCommentIndex(4));
52 var_dump($zip->getArchiveComment());
54 $zip->close();