Remove pclzip lib

This commit is contained in:
shreesh arora
2021-03-05 19:08:19 +05:30
parent 82b30db256
commit 6579d21f15
7 changed files with 15 additions and 6256 deletions

View File

@@ -2854,14 +2854,9 @@ exit;
*/
public static function ZipTest($from_file)
{
if (class_exists('ZipArchive', false)) {
$zip = new ZipArchive();
return ($zip->open($from_file, ZIPARCHIVE::CHECKCONS) === true);
} else {
require_once(_PS_ROOT_DIR_.'/tools/pclzip/pclzip.lib.php');
$zip = new PclZip($from_file);
return ($zip->privCheckFormat() === true);
}
$zip = new ZipArchive();
return ($zip->open($from_file, ZipArchive::CHECKCONS) === true);
}
public static function getSafeModeStatus()
@@ -2881,23 +2876,12 @@ exit;
if (!file_exists($to_dir)) {
mkdir($to_dir, 0777);
}
if (class_exists('ZipArchive', false)) {
$zip = new ZipArchive();
if ($zip->open($from_file) === true && $zip->extractTo($to_dir) && $zip->close()) {
return true;
}
return false;
} else {
require_once(_PS_ROOT_DIR_.'/tools/pclzip/pclzip.lib.php');
$zip = new PclZip($from_file);
$list = $zip->extract(PCLZIP_OPT_PATH, $to_dir, PCLZIP_OPT_REPLACE_NEWER);
foreach ($list as $file) {
if ($file['status'] != 'ok' && $file['status'] != 'already_a_directory') {
return false;
}
}
$zip = new ZipArchive();
if ($zip->open($from_file) === true && $zip->extractTo($to_dir) && $zip->close()) {
return true;
}
return false;
}
public static function chmodr($path, $filemode)