1 |
efrain |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
declare(strict_types=1);
|
|
|
4 |
|
|
|
5 |
namespace ZipStream;
|
|
|
6 |
|
|
|
7 |
/**
|
|
|
8 |
* @internal
|
|
|
9 |
*/
|
|
|
10 |
abstract class GeneralPurposeBitFlag
|
|
|
11 |
{
|
|
|
12 |
/**
|
|
|
13 |
* If set, indicates that the file is encrypted.
|
|
|
14 |
*/
|
|
|
15 |
public const ENCRYPTED = 1 << 0;
|
|
|
16 |
|
|
|
17 |
/**
|
|
|
18 |
* (For Methods 8 and 9 - Deflating)
|
|
|
19 |
* Normal (-en) compression option was used.
|
|
|
20 |
*/
|
|
|
21 |
public const DEFLATE_COMPRESSION_NORMAL = 0 << 1;
|
|
|
22 |
|
|
|
23 |
/**
|
|
|
24 |
* (For Methods 8 and 9 - Deflating)
|
|
|
25 |
* Maximum (-exx/-ex) compression option was used.
|
|
|
26 |
*/
|
|
|
27 |
public const DEFLATE_COMPRESSION_MAXIMUM = 1 << 1;
|
|
|
28 |
|
|
|
29 |
/**
|
|
|
30 |
* (For Methods 8 and 9 - Deflating)
|
|
|
31 |
* Fast (-ef) compression option was used.
|
|
|
32 |
*/
|
|
|
33 |
public const DEFLATE_COMPRESSION_FAST = 10 << 1;
|
|
|
34 |
|
|
|
35 |
/**
|
|
|
36 |
* (For Methods 8 and 9 - Deflating)
|
|
|
37 |
* Super Fast (-es) compression option was used.
|
|
|
38 |
*/
|
|
|
39 |
public const DEFLATE_COMPRESSION_SUPERFAST = 11 << 1;
|
|
|
40 |
|
|
|
41 |
/**
|
|
|
42 |
* If the compression method used was type 14,
|
|
|
43 |
* LZMA, then this bit, if set, indicates
|
|
|
44 |
* an end-of-stream (EOS) marker is used to
|
|
|
45 |
* mark the end of the compressed data stream.
|
|
|
46 |
* If clear, then an EOS marker is not present
|
|
|
47 |
* and the compressed data size must be known
|
|
|
48 |
* to extract.
|
|
|
49 |
*/
|
|
|
50 |
public const LZMA_EOS = 1 << 1;
|
|
|
51 |
|
|
|
52 |
/**
|
|
|
53 |
* If this bit is set, the fields crc-32, compressed
|
|
|
54 |
* size and uncompressed size are set to zero in the
|
|
|
55 |
* local header. The correct values are put in the
|
|
|
56 |
* data descriptor immediately following the compressed
|
|
|
57 |
* data.
|
|
|
58 |
*/
|
|
|
59 |
public const ZERO_HEADER = 1 << 3;
|
|
|
60 |
|
|
|
61 |
/**
|
|
|
62 |
* If this bit is set, this indicates that the file is
|
|
|
63 |
* compressed patched data.
|
|
|
64 |
*/
|
|
|
65 |
public const COMPRESSED_PATCHED_DATA = 1 << 5;
|
|
|
66 |
|
|
|
67 |
/**
|
|
|
68 |
* Strong encryption. If this bit is set, you MUST
|
|
|
69 |
* set the version needed to extract value to at least
|
|
|
70 |
* 50 and you MUST also set bit 0. If AES encryption
|
|
|
71 |
* is used, the version needed to extract value MUST
|
|
|
72 |
* be at least 51.
|
|
|
73 |
*/
|
|
|
74 |
public const STRONG_ENCRYPTION = 1 << 6;
|
|
|
75 |
|
|
|
76 |
/**
|
|
|
77 |
* Language encoding flag (EFS). If this bit is set,
|
|
|
78 |
* the filename and comment fields for this file
|
|
|
79 |
* MUST be encoded using UTF-8.
|
|
|
80 |
*/
|
|
|
81 |
public const EFS = 1 << 11;
|
|
|
82 |
|
|
|
83 |
/**
|
|
|
84 |
* Set when encrypting the Central Directory to indicate
|
|
|
85 |
* selected data values in the Local Header are masked to
|
|
|
86 |
* hide their actual values.
|
|
|
87 |
*/
|
|
|
88 |
public const ENCRYPT_CENTRAL_DIRECTORY = 1 << 13;
|
|
|
89 |
}
|