◆ __construct()
__construct |
( |
|
$options = array() | ) |
|
Create a new Archive object.
- Paramètres
-
array | \ArrayAccess | $options | An array of options or an object that implements |
- Depuis
- 1.0
- Exceptions
-
Références Zip\$options.
◆ addToZipFile()
addToZipFile |
( |
array & |
$file, |
|
|
array & |
$contents, |
|
|
array & |
$ctrldir |
|
) |
| |
|
private |
◆ checkZipData()
Checks to see if the data is a valid ZIP file.
- Paramètres
-
string | $data | ZIP archive data buffer. |
- Renvoie
- boolean True if valid, false if invalid.
- Depuis
- 1.0
Références Zip\$data.
◆ create()
create |
( |
|
$archive, |
|
|
|
$files |
|
) |
| |
Create a ZIP compressed file from an array of file data.
- Paramètres
-
string | $archive | Path to save archive. |
array | $files | Array of files to add to archive. |
- Renvoie
- boolean True if successful.
- Depuis
- 1.0
Références $file, $files, Zip\addToZipFile(), et Zip\createZipFile().
◆ createZipFile()
createZipFile |
( |
array |
$contents, |
|
|
array |
$ctrlDir, |
|
|
|
$path |
|
) |
| |
|
private |
◆ extract()
extract |
( |
|
$archive, |
|
|
|
$destination |
|
) |
| |
Extract a ZIP compressed file to a given path
- Paramètres
-
string | $archive | Path to ZIP archive to extract |
string | $destination | Path to extract archive into |
- Renvoie
- boolean True if successful
- Depuis
- 1.0
- Exceptions
-
Implémente ExtractableInterface.
Références Zip\extractCustom(), et Zip\extractNative().
◆ extractCustom()
extractCustom |
( |
|
$archive, |
|
|
|
$destination |
|
) |
| |
|
protected |
Extract a ZIP compressed file to a given path using a php based algorithm that only requires zlib support
- Paramètres
-
string | $archive | Path to ZIP archive to extract. |
string | $destination | Path to extract archive into. |
- Renvoie
- boolean True if successful
- Depuis
- 1.0
- Exceptions
-
Références $buffer, $i, Zip\$metadata, $path, Path\clean(), Folder\create(), Zip\getFileData(), Zip\isBelow(), null, Zip\readZipInfo(), et File\write().
Référencé par Zip\extract().
◆ extractNative()
extractNative |
( |
|
$archive, |
|
|
|
$destination |
|
) |
| |
|
protected |
Extract a ZIP compressed file to a given path using native php api calls for speed
- Paramètres
-
string | $archive | Path to ZIP archive to extract |
string | $destination | Path to extract archive into |
- Renvoie
- boolean True on success
- Exceptions
-
Références $buffer, $file, Folder\create(), Zip\isBelow(), et File\write().
Référencé par Zip\extract().
◆ getFileData()
Returns the file data for a file by offset in the ZIP archive
- Paramètres
-
integer | $key | The position of the file in the archive. |
- Renvoie
- string Uncompressed file data buffer.
- Depuis
- 1.0
Références $key.
Référencé par Zip\extractCustom().
◆ hasNativeSupport()
static hasNativeSupport |
( |
| ) |
|
|
static |
Method to determine if the server has native zip support for faster handling
- Renvoie
- boolean True if php has native ZIP support
- Depuis
- 1.0
◆ isBelow()
isBelow |
( |
|
$destination, |
|
|
|
$path |
|
) |
| |
|
private |
◆ isSupported()
Tests whether this adapter can unpack files on this computer.
- Renvoie
- boolean True if supported
- Depuis
- 1.0
Implémente ExtractableInterface.
◆ readZipInfo()
Get the list of files/data from a ZIP archive buffer.
KEY: Position in zipfile
VALUES: 'attr' -- File attributes
'crc' -- CRC checksum
'csize' -- Compressed file size
'date' -- File modification time
'name' -- Filename
'method'-- Compression method
'size' -- Original file size
'type' -- File type
- Paramètres
-
string | $data | The ZIP archive buffer. |
- Renvoie
- boolean True on success
- Depuis
- 1.0
- Exceptions
-
Références Zip\$data, $info, $name, $offset, et null.
Référencé par Zip\extractCustom().
◆ unix2DosTime()
unix2DosTime |
( |
|
$unixtime = null | ) |
|
|
protected |
Converts a UNIX timestamp to a 4-byte DOS date and time format (date in high 2-bytes, time in low 2-bytes allowing magnitude comparison).
- Paramètres
-
integer | $unixtime | The current UNIX timestamp. |
- Renvoie
- integer The current date in a 4-byte DOS format.
- Depuis
- 1.0
Références null.
Référencé par Zip\addToZipFile().
◆ $ctrlDirEnd
$ctrlDirEnd = "\x50\x4b\x05\x06\x00\x00\x00\x00" |
|
private |
◆ $ctrlDirHeader
$ctrlDirHeader = "\x50\x4b\x01\x02" |
|
private |
◆ $data
◆ $fileHeader
$fileHeader = "\x50\x4b\x03\x04" |
|
private |
◆ $metadata
◆ $methods
Valeur initiale := array(
0x0 => 'None',
0x1 => 'Shrunk',
0x2 => 'Super Fast',
0x3 => 'Fast',
0x4 => 'Normal',
0x5 => 'Maximum',
0x6 => 'Imploded',
0x8 => 'Deflated',
)
◆ $options
La documentation de cette classe a été générée à partir du fichier suivant :