xpdo/compression/xpdozip.class.php

Classes 
package
xpdo
subpackage
compression
Classes
xPDOZip

Description

A class to abstract compression support for ZIP format.

This file contains the xPDOZip class to represent ZIP archives.

\xPDOZip

package
xpdo
subpackage
compression
Constants
CREATE
OVERWRITE
ZIP_TARGET
Properties
$_archive
$_errors
$_filename
$_options
$xpdo
Methods
__construct
close
getErrors
getOption
hasError
pack
unpack

Description

Represents a compressed archive in ZIP format.

Constants

CREATE

 CREATE = 'create'

Details

value
create

OVERWRITE

 OVERWRITE = 'overwrite'

Details

value
overwrite

ZIP_TARGET

 ZIP_TARGET = 'zip_target'

Details

value
zip_target

Properties

$_archive

 $_archive = 'null'

Details

visibility
protected
default
null
final
false
static
false

$_errors

 $_errors = 'array'

Details

visibility
protected
default
array
final
false
static
false

$_filename

 $_filename = ''

Details

visibility
protected
default
final
false
static
false

$_options

 $_options = 'array'

Details

visibility
protected
default
array
final
false
static
false

$xpdo

 $xpdo = 'null'

Details

visibility
public
default
null
final
false
static
false

Methods

__construct

__construct( \xPDO $xpdo, string $filename, array $options = array ) :

Construct an instance representing a specific archive.

Arguments
$xpdo
\xPDO
&$xpdo A reference to an xPDO instance.
$filename
string
The name of the archive the instance will represent.
$options
array
An array of options for this instance.
Details
visibility
public
final
false
static
false

close

close( ) :

Close the archive.

Details
visibility
public
final
false
static
false

getErrors

getErrors( ) :

Return any errors from operations on the archive.

Details
visibility
public
final
false
static
false

getOption

getOption( string $key, array $options = null, mixed $default = null ) : mixed

Get an option from supplied options, the xPDOZip instance options, or xpdo itself.

Arguments
$key
string
Unique identifier for the option.
$options
array
A set of explicit options to override those from xPDO or the xPDOZip instance.
$default
mixed
An optional default value to return if no value is found.
Output
mixed
The value of the option.
Details
visibility
public
final
false
static
false

hasError

hasError( ) : boolean

Detect if errors occurred during any operations.

Output
boolean
True if errors exist, otherwise false.
Details
visibility
public
final
false
static
false

pack

pack( string $source, array $options = array ) : array

Pack the contents from the source into the archive.

Arguments
$source
string
The path to the source file(s) to pack.
$options
array
An array of options for the operation.
Output
array
An array of results for the operation.
Details
visibility
public
final
false
static
false
todo
Implement custom file filtering options

unpack

unpack( string $target, array $options = array ) : array

Unpack the compressed contents from the archive to the target.

Arguments
$target
string
The path of the target location to unpack the files.
$options
array
An array of options for the operation.
Output
array
An array of results for the operation.
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox 0.11.2.