◆ _addToZIPFile()
_addToZIPFile |
( |
array & |
$file, |
|
|
array & |
$contents, |
|
|
array & |
$ctrldir |
|
) |
| |
|
private |
Adds a "file" to the ZIP archive.
- Paramètres
-
array | &$file | File data array to add |
array | &$contents | An array of existing zipped files. |
array | &$ctrldir | An array of central directory information. |
- Renvoie
- void
- Depuis
- 1.5
Références $data, $file, $name, et null.
◆ _createZIPFile()
_createZIPFile |
( |
array & |
$contents, |
|
|
array & |
$ctrlDir, |
|
|
|
$path |
|
) |
| |
|
private |
Creates the ZIP file.
Official ZIP file format: https://support.pkware.com/display/PKZIP/APPNOTE
- Paramètres
-
array | &$contents | An array of existing zipped files. |
array | &$ctrlDir | An array of central directory information. |
string | $path | The path to store the archive. |
- Renvoie
- boolean True if successful
- Depuis
- 1.5
Références $buffer, $data, et $path.
◆ _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.5
Références $key.
◆ _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
- 2.5.0
- Exceptions
-
Références $data, $info, $name, $offset, et null.
◆ _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
-
int | $unixtime | The current UNIX timestamp. |
- Renvoie
- int The current date in a 4-byte DOS format.
- Depuis
- 1.5
◆ 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.5
Références $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.5
Références $file, et $files.
◆ extract()
extract |
( |
|
$archive, |
|
|
|
$destination, |
|
|
array |
$options = array() |
|
) |
| |
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 |
array | $options | Extraction options [unused] |
- Renvoie
- boolean True if successful
- Depuis
- 1.5
- Exceptions
-
Implémente JArchiveExtractable.
◆ 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
- mixed True if successful
- Depuis
- 3.0
- Exceptions
-
Références $buffer, $i, $n, $path, et null.
◆ 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
- Depuis
- 3.0
- Exceptions
-
Références $buffer, et $file.
◆ 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.5
◆ isSupported()
Tests whether this adapter can unpack files on this computer.
- Renvoie
- boolean True if supported
- Depuis
- 2.5.0
Implémente JArchiveExtractable.
◆ raiseWarning()
raiseWarning |
( |
|
$code, |
|
|
|
$msg |
|
) |
| |
|
private |
Temporary private method to isolate JError from the extract method This code should be removed when JError is removed.
- Paramètres
-
int | $code | The application-internal error code for this error |
string | $msg | The error message, which may also be shown the user if need be. |
- Renvoie
- JException JException instance if JError class exists
- Depuis
- 3.6.0
- Exceptions
-
RuntimeException | if JError class does not exist |
Références JError\raiseWarning().
◆ $_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',
)
La documentation de cette classe a été générée à partir du fichier suivant :