ZipArchive

Type
Class
Namespace
Craft
Inherits
Craft\ZipArchive
Implements
Craft\IZip
Since
1.0

Class ZipArchive

See also http://craftcms.com

View source

Public Methods

MethodDescription
add()Will add either a file or a folder to an existing zip file. If it is a folder, it will add the contents recursively.
unzip()
zip()

add()

Will add either a file or a folder to an existing zip file. If it is a folder, it will add the contents recursively.

IZip::add()

View source

Arguments

  • $sourceZip (string) – The zip file to be added to.
  • $pathToAdd (string)
  • $basePath (string) – The root path of the file(s) to be added that will be removed before adding.
  • $pathPrefix (null) – A path to be prepended to each file before it is added to the zip.

Returns

boolean

Signature

public boolean add ( $sourceZip, $pathToAdd, $basePath, $pathPrefix = null )

unzip()

IZip::unzip()

View source

Arguments

  • $srcZip
  • $destFolder

Returns

boolean

Signature

public boolean unzip ( $srcZip, $destFolder )

zip()

IZip::zip()

View source

Arguments

  • $sourceFolder
  • $destZip

Returns

boolean

Signature

public boolean zip ( $sourceFolder, $destZip )