Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe JArchiveZip
+ Graphe d'héritage de JArchiveZip:

Fonctions membres publiques

 create ($archive, $files)
 
 extract ($archive, $destination, array $options=array())
 
 checkZipData (&$data)
 

Fonctions membres publiques statiques

static isSupported ()
 
static hasNativeSupport ()
 

Fonctions membres protégées

 extractCustom ($archive, $destination)
 
 extractNative ($archive, $destination)
 
 _unix2DOSTime ($unixtime=null)
 

Fonctions membres privées

 raiseWarning ($code, $msg)
 
 _readZipInfo (&$data)
 
 _getFileData ($key)
 
 _addToZIPFile (array &$file, array &$contents, array &$ctrldir)
 
 _createZIPFile (array &$contents, array &$ctrlDir, $path)
 

Attributs privés

 $_methods
 
 $_ctrlDirHeader = "\x50\x4b\x01\x02"
 
 $_ctrlDirEnd = "\x50\x4b\x05\x06\x00\x00\x00\x00"
 
 $_fileHeader = "\x50\x4b\x03\x04"
 
 $_data = null
 
 $_metadata = null
 

Description détaillée

ZIP format adapter for the JArchive class

The ZIP compression code is partially based on code from: Eric Mueller eric@.nosp@m.them.nosp@m.epark.nosp@m..com http://www.zend.com/codex.php?id=535&single=1

Deins125 webma.nosp@m.ster.nosp@m.@atla.nosp@m.nt.r.nosp@m.u http://www.zend.com/codex.php?id=470&single=1

The ZIP compression date code is partially based on code from Peter Listiak mlady.nosp@m.@use.nosp@m.rs.so.nosp@m.urce.nosp@m.forge.nosp@m..net

This class is inspired from and draws heavily in code and concept from the Compress package of The Horde Project https://www.horde.org

Chuck Hagenbuch chuck.nosp@m.@hor.nosp@m.de.or.nosp@m.g Michael Slusarz slusa.nosp@m.rz@h.nosp@m.orde..nosp@m.org Michael Cochrane mike@.nosp@m.graf.nosp@m.tonha.nosp@m.ll.c.nosp@m.o.nz

Depuis
1.5
Obsolète:
4.0 use the Joomla class instead

Documentation des fonctions membres

◆ _addToZIPFile()

_addToZIPFile ( array &  $file,
array &  $contents,
array &  $ctrldir 
)
private

Adds a "file" to the ZIP archive.

Paramètres
array&$fileFile data array to add
array&$contentsAn array of existing zipped files.
array&$ctrldirAn 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&$contentsAn array of existing zipped files.
array&$ctrlDirAn array of central directory information.
string$pathThe path to store the archive.
Renvoie
boolean True if successful
Depuis
1.5

Références $buffer, $data, et $path.

◆ _getFileData()

_getFileData (   $key)
private

Returns the file data for a file by offset in the ZIP archive

Paramètres
integer$keyThe position of the file in the archive.
Renvoie
string Uncompressed file data buffer.
Depuis
1.5

Références $key.

◆ _readZipInfo()

_readZipInfo ( $data)
private

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&$dataThe ZIP archive buffer.
Renvoie
boolean True on success
Depuis
2.5.0
Exceptions
RuntimeException

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$unixtimeThe current UNIX timestamp.
Renvoie
int The current date in a 4-byte DOS format.
Depuis
1.5

◆ checkZipData()

checkZipData ( $data)

Checks to see if the data is a valid ZIP file.

Paramètres
string&$dataZIP 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$archivePath to save archive.
array$filesArray 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$archivePath to ZIP archive to extract
string$destinationPath to extract archive into
array$optionsExtraction options [unused]
Renvoie
boolean True if successful
Depuis
1.5
Exceptions
RuntimeException

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$archivePath to ZIP archive to extract.
string$destinationPath to extract archive into.
Renvoie
mixed True if successful
Depuis
3.0
Exceptions
RuntimeException

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$archivePath to ZIP archive to extract
string$destinationPath to extract archive into
Renvoie
boolean True on success
Depuis
3.0
Exceptions
RuntimeException

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()

static isSupported ( )
static

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$codeThe application-internal error code for this error
string$msgThe 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
RuntimeExceptionif JError class does not exist

Références JError\raiseWarning().

Documentation des champs

◆ $_ctrlDirEnd

$_ctrlDirEnd = "\x50\x4b\x05\x06\x00\x00\x00\x00"
private

◆ $_ctrlDirHeader

$_ctrlDirHeader = "\x50\x4b\x01\x02"
private

◆ $_data

$_data = null
private

◆ $_fileHeader

$_fileHeader = "\x50\x4b\x03\x04"
private

◆ $_metadata

$_metadata = null
private

◆ $_methods

$_methods
private
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 :