Skip to content

Commit 5c4e1ce

Browse files
authored
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.
1 parent 8657f80 commit 5c4e1ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Composer/Package/Archiver/ZipArchiver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ public function archive($sources, $target, $format, array $excludes = array(), $
5151

5252
/**
5353
* ZipArchive::setExternalAttributesName is available from >= PHP 5.6
54+
* setExternalAttributesName() is only available with libzip 0.11.2 or above
5455
*/
55-
if (PHP_VERSION_ID >= 50600) {
56+
if (PHP_VERSION_ID >= 50600 && method_exists($zip, 'setExternalAttributesName')) {
5657
$perms = fileperms($filepath);
5758

5859
/**

0 commit comments

Comments
 (0)