\PhpZip\Model\Extra\FieldsNewUnixExtraField

Info-ZIP New Unix Extra Field: ====================================.

Currently stores Unix UIDs/GIDs up to 32 bits. (Last Revision 20080509)

Value Size Description


(UnixN) 0x7875 Short tag for this extra block type ("ux") TSize Short total data size for this block Version 1 byte version of this extra field, currently 1 UIDSize 1 byte Size of UID field UID Variable UID for this entry GIDSize 1 byte Size of GID field GID Variable GID for this entry

Currently Version is set to the number 1. If there is a need to change this field, the version will be incremented. Changes may not be backward compatible so this extra field should not be used if the version is not recognized.

UIDSize is the size of the UID field in bytes. This size should match the size of the UID field on the target OS.

UID is the UID for this entry in standard little endian format.

GIDSize is the size of the GID field in bytes. This size should match the size of the GID field on the target OS.

GID is the GID for this entry in standard little endian format.

If both the old 16-bit Unix extra field (tag 0x7855, Info-ZIP Unix) and this extra field are present, the values in this extra field supercede the values in that extra field.

Summary

Methods
Properties
Constants
__construct()
getHeaderId()
unpackLocalFileData()
unpackCentralDirData()
packLocalFileData()
packCentralDirData()
getUid()
setUid()
getGid()
setGid()
getVersion()
__toString()
No public properties found
HEADER_ID
USER_GID_PID
No protected methods found
No protected properties found
N/A
readSizeIntegerLE()
$version
$uid
$gid
N/A

Constants

HEADER_ID

HEADER_ID = 0x7875 : int

USER_GID_PID

USER_GID_PID = 1000

ID of the first non-root user created on a unix system.

Properties

$version

$version : int

Type

int — version of this extra field, currently 1

$uid

$uid : int

Type

int — User id

$gid

$gid : int

Type

int — Group id

Methods

__construct()

__construct(int  $version = 1, int  $uid = self::USER_GID_PID, int  $gid = self::USER_GID_PID) : mixed

NewUnixExtraField constructor.

Parameters

int $version
int $uid
int $gid

Returns

mixed —

getHeaderId()

getHeaderId() : int

Returns the Header ID (type) of this Extra Field.

The Header ID is an unsigned short integer (two bytes) which must be constant during the life cycle of this object.

Returns

int —

unpackLocalFileData()

unpackLocalFileData(string  $buffer, \PhpZip\Model\ZipEntry|null  $entry = null) : \PhpZip\Model\Extra\Fields\NewUnixExtraField

Populate data from this array as if it was in local file data.

Parameters

string $buffer

the buffer to read data from

\PhpZip\Model\ZipEntry|null $entry

Throws

\PhpZip\Exception\ZipException

Returns

\PhpZip\Model\Extra\Fields\NewUnixExtraField —

unpackCentralDirData()

unpackCentralDirData(string  $buffer, \PhpZip\Model\ZipEntry|null  $entry = null) : \PhpZip\Model\Extra\Fields\NewUnixExtraField

Populate data from this array as if it was in central directory data.

Parameters

string $buffer

the buffer to read data from

\PhpZip\Model\ZipEntry|null $entry

Throws

\PhpZip\Exception\ZipException

Returns

\PhpZip\Model\Extra\Fields\NewUnixExtraField —

packLocalFileData()

packLocalFileData() : string

The actual data to put into local file data - without Header-ID or length specifier.

Returns

string —

the data

packCentralDirData()

packCentralDirData() : string

The actual data to put into central directory - without Header-ID or length specifier.

Returns

string —

the data

getUid()

getUid() : int

Returns

int —

setUid()

setUid(int  $uid) : mixed

Parameters

int $uid

Returns

mixed —

getGid()

getGid() : int

Returns

int —

setGid()

setGid(int  $gid) : mixed

Parameters

int $gid

Returns

mixed —

getVersion()

getVersion() : int

Returns

int —

__toString()

__toString() : string

Returns

string —

readSizeIntegerLE()

readSizeIntegerLE(string  $data, int  $size) : int

Parameters

string $data
int $size

Throws

\PhpZip\Exception\ZipException

Returns

int —