Lines Matching refs:zip
4 zip
8 $name = __DIR__ . '/getstream.zip';
10 $zip = new ZipArchive;
11 $r = $zip->open($name, ZIPARCHIVE::CREATE);
12 $zip->addFromString('foo.txt', 'foo');
13 $zip->addFromString('bar.txt', 'bar');
14 $zip->close();
16 $r = $zip->open($name);
18 $zip->addFromString('bar.txt', 'baz', ZipArchive::FL_OVERWRITE);
22 $fp = $zip->getStreamName('foo.txt');
23 var_dump($zip->status);
25 $zip->clearError();
29 $fp = $zip->getStreamIndex(0);
30 var_dump($zip->status);
32 $zip->clearError();
36 $fp = $zip->getStreamIndex(1);
39 var_dump($zip->status === ZipArchive::ER_CHANGED);
41 var_dump($zip->status === 0 && stream_get_contents($fp) === "baz");
43 $zip->clearError();
46 $fp = $zip->getStreamIndex(1, ZipArchive::FL_UNCHANGED);
47 var_dump($zip->status === 0 && stream_get_contents($fp) === "bar");
48 $zip->clearError();
51 $zip->close();
56 $name = __DIR__ . '/getstream.zip';