Issue #3163123 by Spokje, anmolgoyal74, andypost, guilhermevp, Niklan, Hardik_Patel_12, quietone, larowlan: Error: Class 'ZipArchive' not found in Drupal\Core\Archiver\Zip->__construct() (line 30 of core/lib/Drupal/Core/Archiver/Zip.php)

merge-requests/2974/head
Dave Long 2022-11-17 17:32:15 +00:00
parent 824ea0e817
commit 7715163310
No known key found for this signature in database
GPG Key ID: ED52AE211E142771
3 changed files with 17 additions and 1 deletions

5
composer.lock generated
View File

@ -443,7 +443,7 @@
"dist": {
"type": "path",
"url": "core",
"reference": "938187e9cd9745789a97efca65f1515cd4aed57f"
"reference": "7f3a4442b8f97a22b50998a09c3d0d0a56725fc0"
},
"require": {
"asm89/stack-cors": "^2.1",
@ -514,6 +514,9 @@
"drupal/core-uuid": "self.version",
"drupal/core-version": "self.version"
},
"suggest": {
"ext-zip": "Needed to extend the plugin.manager.archiver service capability with the handling of files in the ZIP format."
},
"type": "drupal-core",
"extra": {
"drupal-scaffold": {

View File

@ -109,6 +109,9 @@
"config": {
"preferred-install": "dist"
},
"suggest": {
"ext-zip": "Needed to extend the plugin.manager.archiver service capability with the handling of files in the ZIP format."
},
"extra": {
"drupal-scaffold": {
"file-mapping": {

View File

@ -1389,3 +1389,13 @@ function system_file_download($uri) {
}
}
}
/**
* Implements hook_archiver_info_alter().
*/
function system_archiver_info_alter(&$info) {
if (!class_exists(\ZipArchive::class)) {
// PHP Zip extension is missing.
unset($info['Zip']);
}
}