spunQ_PhpZipHandler Class Reference

A class which implements zipfile handling using php's builtin zip commands. More...

Inheritance diagram for spunQ_PhpZipHandler:

spunQ_ZipHandler spunQ_IArchiveHandler

List of all members.

Public Member Functions

 isAvailable ()
 Tests if the handler's zip functions are available or not.
 createZip (spunQ_Folder $folder, $archiveName, array $fileNodes)
 Creates a zipfile.
 extract (spunQ_ArchiveFile $file, spunQ_Folder $folder)
 Extracts the contents of an archive into given folder.

Static Public Member Functions

static getInstance ()
 Retrieves Singleton instance.
static setHandler (spunQ_ZipHandler $handler)
 Sets the zip handler.

Private Member Functions

 addNodeToZipRecursive ($node, $zipArchive, $toBeArchived)
 Recursively adds a directory to a zip archive.

Static Private Attributes

static $instance = NULL
 Singleton instance.


Detailed Description

A class which implements zipfile handling using php's builtin zip commands.

Definition at line 14 of file PhpZipHandler.class.php.


Member Function Documentation

spunQ_PhpZipHandler::addNodeToZipRecursive ( node,
zipArchive,
toBeArchived 
) [private]

Recursively adds a directory to a zip archive.

Parameters:
$node A spunQ_FileNode to be added to the zip archive (the point where we are on this call)
$zipArchive A php ZipArchive
$toBeArchived The spunQ_Folder where we are adding files or directories

Definition at line 79 of file PhpZipHandler.class.php.

spunQ_PhpZipHandler::createZip ( spunQ_Folder folder,
archiveName,
array $  fileNodes 
)

Creates a zipfile.

Parameters:
$folder A spunQ_Folder where the archive should be created.
$archiveName A string which is the name of the zipfile to be created; NOTE: this name should end in ".zip"!!
$fileNodes An array of spunQ_FileNodes to be zipped.
Returns:
void
Exceptions:
spunQ_IOException 

Reimplemented from spunQ_ZipHandler.

Definition at line 43 of file PhpZipHandler.class.php.

spunQ_PhpZipHandler::extract ( spunQ_ArchiveFile file,
spunQ_Folder folder 
)

Extracts the contents of an archive into given folder.

Parameters:
$file The archive to extract
$folder The folder to extract to
Returns:
void
Exceptions:
spunQ_IOException 

Implements spunQ_IArchiveHandler.

Definition at line 61 of file PhpZipHandler.class.php.

static spunQ_PhpZipHandler::getInstance (  )  [static]

Retrieves Singleton instance.

Returns:
spunQ_PhpZipHandler

Reimplemented from spunQ_ZipHandler.

Definition at line 26 of file PhpZipHandler.class.php.

spunQ_PhpZipHandler::isAvailable (  ) 

Tests if the handler's zip functions are available or not.

Returns:
bool

Reimplemented from spunQ_ZipHandler.

Definition at line 36 of file PhpZipHandler.class.php.

static spunQ_ZipHandler::setHandler ( spunQ_ZipHandler handler  )  [static, inherited]

Sets the zip handler.

Mainly for testing purposes.

Parameters:
$handler The handler to use
Returns:
void

Definition at line 45 of file ZipHandler.class.php.


Member Data Documentation

spunQ_PhpZipHandler::$instance = NULL [static, private]

Singleton instance.

Type:
spunQ_PhpZipHandler

Reimplemented from spunQ_ZipHandler.

Definition at line 20 of file PhpZipHandler.class.php.


The documentation for this class was generated from the following file:

Generated on Fri Jul 1 11:12:43 2011 for spunQ3 by  doxygen 1.5.9