mirror of
https://github.com/Ne-Lexa/php-zip.git
synced 2025-10-19 00:56:25 +02:00
zip extra tests, php 32-bit compat
This commit is contained in:
@@ -115,25 +115,6 @@ class NewUnixExtraField implements ZipExtraField
|
||||
return new self($data['version'], $gid, $uid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a signed byte into an unsigned integer representation
|
||||
* (e.g., -1 becomes 255).
|
||||
*
|
||||
* @param int $b byte to convert to int
|
||||
*
|
||||
* @return int representation of the provided byte
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public static function signedByteToUnsignedInt($b)
|
||||
{
|
||||
if ($b >= 0) {
|
||||
return $b;
|
||||
}
|
||||
|
||||
return 256 + $b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate data from this array as if it was in central directory data.
|
||||
*
|
||||
@@ -160,10 +141,10 @@ class NewUnixExtraField implements ZipExtraField
|
||||
return pack(
|
||||
'CCVCV',
|
||||
$this->version,
|
||||
4, // GIDSize
|
||||
$this->gid,
|
||||
4, // UIDSize
|
||||
$this->uid
|
||||
$this->uid,
|
||||
4, // GIDSize
|
||||
$this->gid
|
||||
);
|
||||
}
|
||||
|
||||
@@ -233,6 +214,14 @@ class NewUnixExtraField implements ZipExtraField
|
||||
$this->gid = $gid & 0xffffffff;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getVersion()
|
||||
{
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
Reference in New Issue
Block a user