Archive

An Archive handling class

since

1.0

package

Joomla Framework

Methods

__construct

Create a new Archive object.

__construct(array|\ArrayAccess options = []) : mixed
since

1.0

throws

\InvalidArgumentException

Arguments

options

array|\ArrayAccessAn array of options

Response

mixed

extract

Extract an archive file to a directory.

extract(string archivename, string extractdir) : bool
since

1.0

throws

\Joomla\Archive\Exception\UnknownArchiveExceptionif the archive type is not supported

Arguments

archivename

stringThe name of the archive file

extractdir

stringDirectory to unpack into

Response

boolTrue for success

getAdapter

Get a file compression adapter.

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

1.0

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, bool override = true) : $this
since

1.0

throws

\Joomla\Archive\Exception\UnsupportedArchiveExceptionif the adapter type is not supported

Arguments

type

stringName of the adapter to set.

class

stringFQCN of your class which implements ExtractableInterface.

override

boolTrue to force override the adapter type.

Response

$this

Properties

adapters

The array of instantiated archive adapters.

since

1.0

Type(s)

\Joomla\Archive\ExtractableInterface[]

options

Holds the options array.

since

1.0

Type(s)

array|\ArrayAccess