Changeset 2078
- Timestamp:
- 01/22/08 02:36:39 (7 months ago)
- Files:
-
- alternc/trunk/bureau/class/m_bro.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
alternc/trunk/bureau/class/m_bro.php
r2077 r2078 420 420 * @return boolean != 0 on error 421 421 */ 422 function brouteur_extract($file, $dest="./")422 function ExtractFile($file, $dest="./") 423 423 { 424 424 static $i=0, $ret; 425 $file = addslashes($file);426 $dest = addslashes($dest);425 $file = $this->convertabsolute($file,0); 426 $dest = $this->convertabsolute($dest,0); 427 427 if ($i == 0) { 428 428 #TODO new version of tar supports `tar xf ...` so there is no … … 433 433 } else if ($i == 2) { 434 434 exec("unzip '$file' -d '$dest'", $void, $ret); 435 } else if ($i == 3) {436 #FIXME I suck at extracting a rar archive to a specified directory437 # but I think unrar just sucks <TM>438 $rarfile = ereg_replace('[a-z0-9]+', '..', $dest)."/$file";439 exec("mkdir -p '$dest'");440 exec("cd '$dest' && unrar x -o+ '$rarfile'", $void, $ret);441 435 } else { 442 436 return $ret; … … 445 439 if ($ret) { 446 440 $i++; 447 brouteur_extract($file, $dest);441 $this->ExtractFile($file, $dest); 448 442 } 449 443 return $ret; … … 460 454 * @return boolean false on error 461 455 */ 462 function brouteur_copy($name, $src, $dest)456 function CopyFile($name, $src, $dest) 463 457 { 464 458 global $error, $db;
