◆ __construct()
__construct |
( |
|
$options = [] | ) |
|
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 |
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.0
Références Zip\$data, $name, null, et Zip\unix2DosTime().
Référencé par Zip\create().
◆ 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 Zip\addToZipFile(), et Zip\createZipFile().
◆ createZipFile()
createZipFile |
( |
array |
$contents, |
|
|
array |
$ctrlDir, |
|
|
string |
$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, 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, $last, $name, Joomla\Database\Query\$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().
◆ $data
◆ $metadata
◆ $options
◆ CTRL_DIR_END
const CTRL_DIR_END = "\x50\x4b\x05\x06\x00\x00\x00\x00" |
|
private |
◆ CTRL_DIR_HEADER
const CTRL_DIR_HEADER = "\x50\x4b\x01\x02" |
|
private |
◆ FILE_HEADER
const FILE_HEADER = "\x50\x4b\x03\x04" |
|
private |
◆ METHODS
La documentation de cette classe a été générée à partir du fichier suivant :