\PhpZip\Model\Extra\FieldsJarMarkerExtraField

Jar Marker Extra Field.

An executable Java program can be packaged in a JAR file with all the libraries it uses. Executable JAR files can easily be distinguished from the files packed in the JAR file by the extra field in the first file, which is hexadecimal in the 0xCAFE bytes series. If this extra field is added as the very first extra field of the archive, Solaris will consider it an executable jar file.

Summary

Methods
Properties
Constants
setJarMarker()
getHeaderId()
packLocalFileData()
packCentralDirData()
unpackLocalFileData()
unpackCentralDirData()
__toString()
No public properties found
HEADER_ID
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

HEADER_ID

HEADER_ID = 0xcafe : int

Methods

setJarMarker()

setJarMarker(\PhpZip\Model\ZipContainer  $container) : mixed

Parameters

\PhpZip\Model\ZipContainer $container

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 —

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

unpackLocalFileData()

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

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

on error

Returns

\PhpZip\Model\Extra\Fields\JarMarkerExtraField —

unpackCentralDirData()

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

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

on error

Returns

\PhpZip\Model\Extra\Fields\JarMarkerExtraField —

__toString()

__toString() : string

Returns

string —