\PhpZip\Model\Extra\FieldsOldUnixExtraField

Info-ZIP Unix Extra Field (type 1): ==================================.

The following is the layout of the old Info-ZIP extra block for Unix. It has been replaced by the extended-timestamp extra block (0x5455) and the Unix type 2 extra block (0x7855). (Last Revision 19970118)

Local-header version:

Value Size Description


(Unix1) 0x5855 Short tag for this extra block type ("UX") TSize Short total data size for this block AcTime Long time of last access (UTC/GMT) ModTime Long time of last modification (UTC/GMT) UID Short Unix user ID (optional) GID Short Unix group ID (optional)

Central-header version:

Value Size Description


(Unix1) 0x5855 Short tag for this extra block type ("UX") TSize Short total data size for this block AcTime Long time of last access (GMT/UTC) ModTime Long time of last modification (GMT/UTC)

The file access and modification times are in standard Unix signed- long format, indicating the number of seconds since 1 January 1970 00:00:00. The times are relative to Coordinated Universal Time (UTC), also sometimes referred to as Greenwich Mean Time (GMT). To convert to local time, the software must know the local timezone offset from UTC/GMT. The modification time may be used by non-Unix systems to support inter-timezone freshening and updating of zip archives.

The local-header extra block may optionally contain UID and GID info for the file. The local-header TSize value is the only indication of this. Note that Unix UIDs and GIDs are usually specific to a particular machine, and they generally require root access to restore.

This extra field type is obsolete, but it has been in use since mid-1994. Therefore future archiving software should continue to support it.

Summary

Methods
Properties
Constants
__construct()
getHeaderId()
unpackLocalFileData()
unpackCentralDirData()
packLocalFileData()
packCentralDirData()
getAccessTime()
setAccessTime()
getAccessDateTime()
getModifyTime()
setModifyTime()
getModifyDateTime()
getUid()
setUid()
getGid()
setGid()
__toString()
No public properties found
HEADER_ID
No protected methods found
No protected properties found
N/A
No private methods found
$accessTime
$modifyTime
$uid
$gid
N/A

Constants

HEADER_ID

HEADER_ID = 0x5855 : int

Properties

$accessTime

$accessTime : int|null

Type

int|null — Access timestamp

$modifyTime

$modifyTime : int|null

Type

int|null — Modify timestamp

$uid

$uid : int|null

Type

int|null — User id

$gid

$gid : int|null

Type

int|null — Group id

Methods

__construct()

__construct(int|null  $accessTime, int|null  $modifyTime, int|null  $uid, int|null  $gid) : mixed

Parameters

int|null $accessTime
int|null $modifyTime
int|null $uid
int|null $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\OldUnixExtraField

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

Returns

\PhpZip\Model\Extra\Fields\OldUnixExtraField —

unpackCentralDirData()

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

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

Returns

\PhpZip\Model\Extra\Fields\OldUnixExtraField —

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

getAccessTime()

getAccessTime() : int|null

Returns

int|null —

setAccessTime()

setAccessTime(int|null  $accessTime) : mixed

Parameters

int|null $accessTime

Returns

mixed —

getAccessDateTime()

getAccessDateTime() : \DateTimeInterface|null

Returns

\DateTimeInterface|null —

getModifyTime()

getModifyTime() : int|null

Returns

int|null —

setModifyTime()

setModifyTime(int|null  $modifyTime) : mixed

Parameters

int|null $modifyTime

Returns

mixed —

getModifyDateTime()

getModifyDateTime() : \DateTimeInterface|null

Returns

\DateTimeInterface|null —

getUid()

getUid() : int|null

Returns

int|null —

setUid()

setUid(int|null  $uid) : mixed

Parameters

int|null $uid

Returns

mixed —

getGid()

getGid() : int|null

Returns

int|null —

setGid()

setGid(int|null  $gid) : mixed

Parameters

int|null $gid

Returns

mixed —

__toString()

__toString() : string

Returns

string —