Archive

An Archive handling class

since

1.0

Methods

__construct

Create a new Archive object.

__construct(array|\ArrayAccess $options = array()) 
since

1.0

throws

\InvalidArgumentException

Arguments

$options

array|\ArrayAccessAn array of options

extract

Extract an archive file to a directory.

extract(string $archivename, string $extractdir) : boolean
since

1.0

throws

\InvalidArgumentException

Arguments

$archivename

stringThe name of the archive file

$extractdir

stringDirectory to unpack into

Response

booleanTrue for success

getAdapter

Get a file compression adapter.

getAdapter(string $type) : \Joomla\Archive\ExtractableInterface
since

1.0

throws

\InvalidArgumentException

Arguments

$type

stringThe type of adapter (bzip2|gzip|tar|zip).

Response

\Joomla\Archive\ExtractableInterfaceAdapter for the requested type

setAdapter

Method to override the provided adapter with your own implementation.

setAdapter(string $type, string $class, boolean $override = true) : \Joomla\Archive\Archive
since

1.0

throws

\InvalidArgumentException

Arguments

$type

stringName of the adapter to set.

$class

stringFQCN of your class which implements ExtractableInterface.

$override

booleanTrue to force override the adapter type.

Response

\Joomla\Archive\ArchiveThis object for chaining.

Properties

adapters

The array of instantiated archive adapters.

since

1.0

Type(s)

array<mixed,\Joomla\Archive\ExtractableInterface>

options

Holds the options array.

since

1.0

Type(s)

array|\ArrayAccess