[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/file/unpacker/ -> unpacker.class.php (sommaire)

\defgroup File_Unpacker This module implements support for easily unpacking files compressed with .zip, .tar.gz, .tar.bz2 and .rar provided that all the binary tools are available.

Poids: 139 lignes (5 kb)
Inclus ou requis:0 fois
Référencé: 1 fois
Nécessite: 0 fichiers

Définit 1 class

Unpacker:: (3 méthodes):
  Unpacker()
  _findUnpacker()
  unpack()


Classe: Unpacker  - X-Ref

\ingroup File_Unpacker

Class that implements an object capable of unpacking several different
kinds of compressed files. It will take care of finding the right unpacker class for the
job, call it and return a result from it, so <b>there is no need to create instances of
the other unpacker classes</b>.

Example of usage:

<pre>
$unpacker = new Unpacker();
$unpacker->unpack( "/tmp/my_uploaded_file.tar.gz", "/tmp/results" );
</pre>

More unpacker classes can be added if needed.

Unpacker( $method = UNPACKER_AUTODETECT )   X-Ref
Creates an object of this class. The first parameter is the
name of the file while the second parameter is the method
we'd like to use. The class is able to to auto-detect
the file we're using, but we can still force one specific
unpacking method.

param: method The method we'd like to use to unpack the file. It defaults to

_findUnpacker()   X-Ref
finds the right unpacker class


unpack( $file, $destFolder = "./" )   X-Ref
Unpacks the file using the selected method to the destination
folder. The method used to unpack the file will be autodetected from the file type
unless the parameter to the autoconstructor is different from UNPACKER_AUTODETECT

param: file path to the file that we're going to unpack
param: destFolder destination folder where files should be unpacked
return: UNPACKER_UNSUPPORTED if the file cannot be unpacked with any of the known unpacker



Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics