class JArchiveZip extends JObject


Located at : UKNOWVA_ROOT/libraries/joomla/filesystem/archive/zip.php

ZIP format adapter for the JArchive class

The ZIP compression code is partially based on code from: Eric Mueller eric@themepark.com http://www.zend.com/codex.php?id=535&single=1

Deins125 webmaster@atlant.ru http://www.zend.com/codex.php?id=470&single=1

The ZIP compression date code is partially based on code from Peter Listiak mlady@users.sourceforge.net

This class is inspired from and draws heavily in code and concept from the Compress package of The Horde Project http://www.horde.org

Properties

array $_methods ZIP compression methods.
string $_ctrlDirHeader Beginning of central directory record.
string $_ctrlDirEnd End of central directory record.
string $_fileHeader Beginning of file contents.
string $_data ZIP file data buffer
array $_metadata ZIP file metadata array

Methods

__construct(mixed $properties = null)

Class constructor, overridden in descendant classes.

from JObject
string
__toString()

Magic method to convert the object to a string gracefully.

from JObject
mixed
def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

from JObject
mixed
get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

from JObject
array
getProperties(boolean $public = true)

Returns an associative array of object properties.

from JObject
string
getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

from JObject
array
getErrors()

Return all errors, if any.

from JObject
mixed
set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

from JObject
boolean
setProperties(mixed $properties)

Set the object properties based on a named array/hash.

from JObject
void
setError(string $error)

Add an error message.

from JObject
string
toString() deprecated

No description

from JObject
boolean
create(string $archive, array $files, array $options = array())

Create a ZIP compressed file from an array of file data.

boolean
extract(string $archive, string $destination, array $options = array())

Extract a ZIP compressed file to a given path

boolean
hasNativeSupport()

Method to determine if the server has native zip support for faster handling

boolean
checkZipData(string $data)

Checks to see if the data is a valid ZIP file.

Details

in JObject at line 42
JObject __construct(mixed $properties = null)

Class constructor, overridden in descendant classes.

Parameters

mixed $properties Either and associative array or another object to set the initial properties of the object.

Return Value

JObject

in JObject at line 56
string __toString()

Magic method to convert the object to a string gracefully.

Return Value

string The classname.

in JObject at line 70
mixed def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed

in JObject at line 88
mixed get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed The value of the property.

See also

getProperties()

in JObject at line 107
array getProperties(boolean $public = true)

Returns an associative array of object properties.

Parameters

boolean $public If true, returns only the public properties.

Return Value

array

See also

get()

in JObject at line 133
string getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

Parameters

integer $i Option error index.
boolean $toString Indicates if JError objects should return their error message.

Return Value

string Error message

in JObject at line 165
array getErrors()

Return all errors, if any.

Return Value

array Array of error messages or JErrors.

in JObject at line 180
mixed set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

Parameters

string $property The name of the property.
mixed $value The value of the property to set.

Return Value

mixed Previous value of the property.

in JObject at line 198
boolean setProperties(mixed $properties)

Set the object properties based on a named array/hash.

Parameters

mixed $properties Either an associative array or another object.

Return Value

boolean

See also

set()

in JObject at line 222
void setError(string $error)

Add an error message.

Parameters

string $error Error message.

Return Value

void

in JObject at line 235
string toString() deprecated

deprecated 12.1 Use magic method __toString()

Return Value

string

See also

__toString()

at line 108
boolean create(string $archive, array $files, array $options = array())

Create a ZIP compressed file from an array of file data.

Parameters

string $archive Path to save archive.
array $files Array of files to add to archive.
array $options Compression options (unused).

Return Value

boolean True if successful.

at line 133
boolean extract(string $archive, string $destination, array $options = array())

Extract a ZIP compressed file to a given path

Parameters

string $archive Path to ZIP archive to extract
string $destination Path to extract archive into
array $options Extraction options [unused]

Return Value

boolean True if successful

at line 156
boolean hasNativeSupport()

Method to determine if the server has native zip support for faster handling

Return Value

boolean True if php has native ZIP support

at line 170
boolean checkZipData(string $data)

Checks to see if the data is a valid ZIP file.

Parameters

string $data &$data ZIP archive data buffer.

Return Value

boolean True if valid, false if invalid.