ryxeo-webphotoalbum-git / www / extract.php @ 108e72d8
Historique | Voir | Annoter | Télécharger (683 octets)
1 | 108e72d8 | Eric Seigne | <?php
|
---|---|---|---|
2 | //Eric Seigne <eric.seigne@ryxeo.com>
|
||
3 | //GNU/GPL
|
||
4 | print "<pre>"; |
||
5 | require_once("zip/pclzip.lib.php"); |
||
6 | if($_GET['src'] != "" && $_GET['dst'] != "") { |
||
7 | $base = getcwd() . "/"; |
||
8 | print "on est ici : " . getcwd() . "\n"; |
||
9 | print "on essaye de decompresser " . $_GET['src'] . " vers " . $_GET['dst'] . "\n"; |
||
10 | if(file_exists($base . $_GET['src'])) { |
||
11 | $archive = new PclZip($base . $_GET['src']); |
||
12 | //Extrait dans le repertoire courant.
|
||
13 | if(is_dir($base . $_GET['dst'])) { |
||
14 | chdir($base . $_GET['dst']); |
||
15 | $list = $archive->extract(); |
||
16 | if($list == 0) { |
||
17 | die("Error : ".$archive->errorInfo(true)); |
||
18 | } |
||
19 | else {
|
||
20 | print_r($list); |
||
21 | } |
||
22 | } |
||
23 | } |
||
24 | } |
||
25 | |||
26 | ?> |