mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
[VD:abstract,LocalFileSystem] fix #1087 support PHP ZipArchive class
This commit is contained in:
@@ -802,24 +802,6 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack archive
|
||||
*
|
||||
* @param string $path archive path
|
||||
* @param array $arc archiver command and arguments (same as in $this->archivers)
|
||||
* @return void
|
||||
* @author Dmitry (dio) Levashov
|
||||
* @author Alexey Sukhotin
|
||||
**/
|
||||
protected function _unpack($path, $arc) {
|
||||
$cwd = getcwd();
|
||||
$dir = $this->_dirname($path);
|
||||
chdir($dir);
|
||||
$cmd = $arc['cmd'].' '.$arc['argc'].' '.escapeshellarg($this->_basename($path));
|
||||
$this->procExec($cmd, $o, $c);
|
||||
chdir($cwd);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive symlinks search
|
||||
*
|
||||
@@ -886,8 +868,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
}
|
||||
|
||||
// extract in quarantine
|
||||
$this->_unpack($archive, $arc);
|
||||
unlink($archive);
|
||||
$this->unpackArchive($archive, $arc);
|
||||
|
||||
// get files list
|
||||
$ls = array();
|
||||
@@ -983,17 +964,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
* @author Alexey Sukhotin
|
||||
**/
|
||||
protected function _archive($dir, $files, $name, $arc) {
|
||||
$cwd = getcwd();
|
||||
chdir($dir);
|
||||
|
||||
$files = array_map('escapeshellarg', $files);
|
||||
|
||||
$cmd = $arc['cmd'].' '.$arc['argc'].' '.escapeshellarg($name).' '.implode(' ', $files);
|
||||
$this->procExec($cmd, $o, $c);
|
||||
chdir($cwd);
|
||||
|
||||
$path = $dir.DIRECTORY_SEPARATOR.$name;
|
||||
return file_exists($path) ? $path : false;
|
||||
return $this->makeArchive($dir, $files, $name, $arc);
|
||||
}
|
||||
|
||||
/******************** Over write functions *************************/
|
||||
|
||||
Reference in New Issue
Block a user