Properties

$allowed

$allowed : array

Array of allowed file types.

Type

array

$adapter

$adapter : mixed

Archive adapter

Type

mixed

$fullpath

$fullpath : string

Full path of archive, i.e. '/path/to/archive.ext'

Type

string

$basename

$basename : string

Full basename of archive, i.e. 'archive.ext'

Type

string

$filename

$filename : string

Full filename of archive, i.e. 'archive'

Type

string

$extension

$extension : string

Archive extension, i.e. 'ext'

Type

string

$size

$size : integer

Archive size in bytes

Type

integer

$mime

$mime : string

Archive mime type

Type

string

Methods

__construct()

__construct(string  $archive, string  $password = null, string  $prefix = 'Pop\\Archive\\Adapter\\') : \Pop\Archive\Archive

Constructor

Instantiate the archive object

Parameters

string $archive
string $password
string $prefix

Throws

\Pop\Archive\Exception

Returns

\Pop\Archive\Archive

getFormats()

getFormats() : array

Get formats

Returns

array

getFullPath()

getFullPath() : string

Return the fullpath

Returns

string

getBasename()

getBasename() : string

Return the basename

Returns

string

getFilename()

getFilename() : string

Return the filename

Returns

string

getExtension()

getExtension() : string

Return the extension

Returns

string

getSize()

getSize() : integer

Return the size

Returns

integer

getMime()

getMime() : string

Return the mime

Returns

string

adapter()

adapter() : mixed

Return the adapter object

Returns

mixed

archive()

archive() : mixed

Return the archive object within the adapter object

Returns

mixed

extract()

extract(string  $to = null) : \Pop\Archive\Archive

Extract an archived and/or compressed file

Parameters

string $to

Throws

\Pop\Archive\Exception

Returns

\Pop\Archive\Archive

addFiles()

addFiles(string|array  $files) : \Pop\Archive\Archive

Create an archive file

Parameters

string|array $files

Returns

\Pop\Archive\Archive

listFiles()

listFiles(boolean  $full = false) : array

Return a listing of the contents of an archived file

Parameters

boolean $full

Returns

array

compress()

compress(string  $ext = 'gz') : \Pop\Archive\Archive

Compress an archive file with Gzip or Bzip2

Parameters

string $ext

Returns

\Pop\Archive\Archive

setAdapter()

setAdapter(string  $prefix, string  $password = null) : void

Set the adapter based on the file name

Parameters

string $prefix
string $password

Throws

\Pop\Archive\Exception