Check for ZipArchive class and use alternative if not present
Closed this issue · 3 comments
For users that do not have the ZipArchive class installed on their server, we need to be testing for the presence of the class and if not present, use an alternative zip method. WordPress references this in their own core when extracting plugins/themes by checking for the class and using an alternate method if it's not there. We need to do the same.
If anyone has any bright ideas how we can test this, please don't be shy. :)
Otherwise we'll have to wait until someone reports the ZipArchive problem and then ask them if they'll test these changes for us.
You can temporary comment these strings in the .../extensions/plugin-installer/object.php file (lines 261-265):
//if ( class_exists( 'ZipArchive', false ) ) {
// $res = $this->unzip_file_ziparchive($plugins_zip_path, $plug_file);
//} else {
$res = $this->unzip_file_pclzip($plugins_zip_path, $plug_file);
//}
Thanks, Alex!
I've tested this and can confirm it is working.