summaryrefslogtreecommitdiff
path: root/ext/zip/examples/extract.php
blob: 01a9c75aee14ef72358aef4306c4129ee9162c4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
if (!extension_loaded('zip')) {
    dl('zip.so');
}

$zip = new ZipArchive();

echo $zip->filename . "\n";
$zip->open("test.zip");
/*
$zip->addFile("./modules/");
$zip->addFile("./testempty");
*/
echo $zip->status . "\n";
echo $zip->statusSys . "\n";

echo $zip->numFiles . "\n";
echo $zip->filename . "\n";
var_dump($zip);
$files = array('test', 'testdir/test2');
if (!$zip->extractTo("./testext/path/to", $files)) {
    echo "error!\n";
    echo $zip->status . "\n";
    echo $zip->statusSys . "\n";

}

$zip->close();