From 5c4e1cedb24b3e7f45ee4a5e213fc30635bb2eb0 Mon Sep 17 00:00:00 2001 From: SvenRtbg Date: Mon, 13 Sep 2021 22:30:02 +0200 Subject: [PATCH] Add ability check for ZipArchive (#10092) ZipArchive::setExternalAttributesName() is only available when libzip 0.11.2 or higher is present. This is not the case with at least SUSE SLES 12, so a simple PHP version check will not work here. --- src/Composer/Package/Archiver/ZipArchiver.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Composer/Package/Archiver/ZipArchiver.php b/src/Composer/Package/Archiver/ZipArchiver.php index ec241a026..c0ce41d65 100644 --- a/src/Composer/Package/Archiver/ZipArchiver.php +++ b/src/Composer/Package/Archiver/ZipArchiver.php @@ -51,8 +51,9 @@ class ZipArchiver implements ArchiverInterface /** * ZipArchive::setExternalAttributesName is available from >= PHP 5.6 + * setExternalAttributesName() is only available with libzip 0.11.2 or above */ - if (PHP_VERSION_ID >= 50600) { + if (PHP_VERSION_ID >= 50600 && method_exists($zip, 'setExternalAttributesName')) { $perms = fileperms($filepath); /**