1
0
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:
Ne-Lexa
2020-01-14 16:31:22 +03:00
parent d21fdb35bb
commit 8487dac9df
13 changed files with 246 additions and 122 deletions

View File

@@ -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
*/