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é
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe Zip
+ Graphe d'héritage de Zip:

Fonctions membres publiques

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

Fonctions membres publiques statiques

static isSupported ()
 
static hasNativeSupport ()
 

Fonctions membres protégées

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

Attributs protégés

 $options = array()
 

Fonctions membres privées

 readZipInfo ($data)
 
 getFileData ($key)
 
 addToZipFile (array &$file, array &$contents, array &$ctrldir)
 
 createZipFile (array $contents, array $ctrlDir, $path)
 
 isBelow ($destination, $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
 
 $metadata
 

Description détaillée

ZIP format adapter for the Archive package

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 http://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.0

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $options = array())

Create a new Archive object.

Paramètres
array | \ArrayAccess$optionsAn array of options or an object that implements
Depuis
1.0
Exceptions

Références Zip\$options.

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.0

Références Zip\$ctrlDirHeader, Zip\$data, $file, Zip\$fileHeader, $name, null, et Zip\unix2DosTime().

Référencé par Zip\create().

◆ 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.0

Références Zip\$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.0

Références $file, $files, Zip\addToZipFile(), et Zip\createZipFile().

◆ createZipFile()

createZipFile ( array  $contents,
array  $ctrlDir,
  $path 
)
private

Creates the ZIP file.

Official ZIP file format: http://www.pkware.com/appnote.txt

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.0

Références $buffer, Zip\$data, $path, et File\write().

Référencé par Zip\create().

◆ extract()

extract (   $archive,
  $destination 
)

Extract a ZIP compressed file to a given path

Paramètres
string$archivePath to ZIP archive to extract
string$destinationPath 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$archivePath to ZIP archive to extract.
string$destinationPath 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$archivePath to ZIP archive to extract
string$destinationPath 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()

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.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

Check if a path is below a given destination path

Paramètres
string$destinationRoot path
string$pathPath to check
Renvoie
boolean
Depuis
1.1.10

Références $path, Path\clean(), et Path\resolve().

Référencé par Zip\extractCustom(), et Zip\extractNative().

◆ isSupported()

static isSupported ( )
static

Tests whether this adapter can unpack files on this computer.

Renvoie
boolean True if supported
Depuis
1.0

Implémente ExtractableInterface.

◆ 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
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$unixtimeThe 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().

Documentation des champs

◆ $ctrlDirEnd

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

◆ $ctrlDirHeader

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

Référencé par Zip\addToZipFile().

◆ $data

◆ $fileHeader

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

Référencé par Zip\addToZipFile().

◆ $metadata

$metadata
private

Référencé par Zip\extractCustom().

◆ $methods

$methods
private
Valeur initiale :
= array(
0x0 => 'None',
0x1 => 'Shrunk',
0x2 => 'Super Fast',
0x3 => 'Fast',
0x4 => 'Normal',
0x5 => 'Maximum',
0x6 => 'Imploded',
0x8 => 'Deflated',
)

◆ $options

$options = array()
protected

Référencé par Zip\__construct().


La documentation de cette classe a été générée à partir du fichier suivant :