core/xpdo/compression/xpdozip.class.php
A class to abstract compression support for ZIP format.
This file contains the xPDOZip class to represent ZIP archives.
- Package
- xpdo
- Subpackage
- compression
\xPDOZip
Represents a compressed archive in ZIP format.
Constants
Properties
Methods

__construct(
\xPDO $xpdo, string $filename, array $options
=
array()
)
:
voidConstruct an instance representing a specific archive.
| 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. |

getOption(
string $key, array $options
=
null, mixed $default
=
null
)
:
mixedGet an option from supplied options, the xPDOZip instance options, or xpdo itself.
| 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. |
| Type | Description |
|---|---|
| mixed | The value of the option. |

hasError(
)
:
booleanDetect if errors occurred during any operations.
| Type | Description |
|---|---|
| boolean | True if errors exist, otherwise false. |

pack(
string $source, array $options
=
array()
)
:
arrayPack the contents from the source into the archive.
| Name | Type | Description |
|---|---|---|
| $source | string | The path to the source file(s) to pack. |
| $options | array | An array of options for the operation. |
| Type | Description |
|---|---|
| array | An array of results for the operation. |
- Todo
- Implement custom file filtering options

unpack(
string $target, array $options
=
array()
)
:
arrayUnpack the compressed contents from the archive to the target.
| Name | Type | Description |
|---|---|---|
| $target | string | The path of the target location to unpack the files. |
| $options | array | An array of options for the operation. |
| Type | Description |
|---|---|
| array | An array of results for the operation. |