Merge pull request #243 from shreesh-webkul/qlo-remove-pclzip
Remove pclzip library
This commit is contained in:
@@ -2796,14 +2796,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()
|
||||
@@ -2823,23 +2818,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)
|
||||
|
||||
Reference in New Issue
Block a user