core/xpdo/compression/xpdozip.class.php

Show: inherited
Table of Contents

A class to abstract compression support for ZIP format.

This file contains the xPDOZip class to represent ZIP archives.

Package
xpdo  
Subpackage
compression  

\xPDOZip

Package: xpdo\compression

Represents a compressed archive in ZIP format.

Constants

Constant  CREATE = 'create'
Constant  OVERWRITE = 'overwrite'
Constant  ZIP_TARGET = 'zip_target'

Properties

Propertyprotected  $_archive= 'null'
Default valuenullDetails
Type
n/a
Propertyprotected  $_errors= 'array()'
Default valuearray()Details
Type
n/a
Propertyprotected  $_filename= ''''
Default value''Details
Type
n/a
Propertyprotected  $_options= 'array()'
Default valuearray()Details
Type
n/a
Propertypublic  $xpdo= 'null'
Default valuenullDetails
Type
n/a

Methods

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

Construct an instance representing a specific archive.

Parameters
Name Type Description
$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.

methodpublicclose( ) : void

Close the archive.

methodpublicgetErrors( ) : void

Return any errors from operations on the archive.

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

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

Parameters
Name Type Description
$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.

Returns
Type Description
mixed The value of the option.
methodpublichasError( ) : boolean

Detect if errors occurred during any operations.

Returns
Type Description
boolean True if errors exist, otherwise false.
methodpublicpack( string $source, array $options = array() ) : array

Pack the contents from the source into the archive.

Parameters
Name Type Description
$source string

The path to the source file(s) to pack.

$options array

An array of options for the operation.

Returns
Type Description
array An array of results for the operation.
Details
Todo
Implement custom file filtering options  
methodpublicunpack( string $target, array $options = array() ) : array

Unpack the compressed contents from the archive to the target.

Parameters
Name Type Description
$target string

The path of the target location to unpack the files.

$options array

An array of options for the operation.

Returns
Type Description
array An array of results for the operation.
Documentation was generated by DocBlox 0.18.1.