Back to index

php5  5.3.10
extract.php
Go to the documentation of this file.
00001 <?php
00002 if (!extension_loaded('zip')) {
00003     dl('zip.so');
00004 }
00005 
00006 $zip = new ZipArchive();
00007 
00008 echo $zip->filename . "\n";
00009 $zip->open("test.zip");
00010 /*
00011 $zip->addFile("./modules/");
00012 $zip->addFile("./testempty");
00013 */
00014 echo $zip->status . "\n";
00015 echo $zip->statusSys . "\n";
00016 
00017 echo $zip->numFiles . "\n";
00018 echo $zip->filename . "\n";
00019 var_dump($zip);
00020 $files = array('test', 'testdir/test2');
00021 if (!$zip->extractTo("./testext/path/to", $files)) {
00022        echo "error!\n";
00023        echo $zip->status . "\n";
00024        echo $zip->statusSys . "\n";
00025 
00026 }
00027 
00028 $zip->close();