# classes/phing/tasks/ext/ZipTask.php

## \ZipFileSet
jump to top

This is a FileSet with the to specify permissions.

Permissions are currently not implemented by PEAR Archive_Tar, but hopefully they will be in the future.

Extends from
  \FileSet
author
  Hans Lellelid (Phing)
author
  Arnout J. Kuiper (Ant)
author
  Stefano Mazzocchi (Ant)
author
  Sam Ruby (Ant)
author
  Jon S. Stevens (Ant)
author
  Stefan Bodewig (Ant)
author
  Magesh Umasankar (Ant)
package
  phing.tasks.ext
version
  $Revision: 744 $ $Date: 2010-03-09 11:08:31 +0100 (Tue, 09 Mar 2010) $

### Properties

`$files= 'null'`
Default value `null` Details

Type

### Methods

`getFiles( $p, $includeEmpty = true ) :`
Get a list of files and directories specified in the fileset.

@return array a list of file and directory names, relative to the baseDir for the project.

Parameters

Name | Type | Description
--- | --- | ---
$p |  |
$includeEmpty |  |

## \ZipTask
jump to top

Creates a zip archive using PHP ZipArchive extension/

This is very closely based on the ANT class of the same name.

Extends from
  \MatchingTask
author
  Michiel Rook
copyright
  2001,2002 THYRELL. All rights reserved
package
  phing.tasks.ext
since
  2.1.0
version
  $Id: ZipTask.php 1084 2011-05-06 09:55:25Z mrook $

### Properties

`\PhingFile $baseDir= ''`

Details

Type
  \PhingFile

`$fileSetFiles= 'array'`
Default value `array` Details

Type

`$filesets= 'array'`
Default value `array` Details

Type

`$includeEmpty= 'true'`

Whether to include empty dirs in the archive.

Default value `true` Details

Type

`string $prefix= 'null'`

File path prefix in zip archive

Default value `null` Details

Type
  string

`\PhingFile $zipFile= ''`

Details

Type
  \PhingFile

### Methods

`archiveIsUpToDate( array $files, \PhingFile $dir ) : boolean`
Parameters

Name | Type | Description
--- | --- | ---
$files | array | array of filenames
$dir | \PhingFile |

Returns

Type | Description
--- | ---
boolean |

`createFileSet( ) : \FileSet`
Add a new fileset.
Returns

Type | Description
--- | ---
\FileSet |

`main( ) :`
do the work
Details

throws

`setBasedir( \PhingFile $baseDir ) :`
This is the base directory to look in for things to zip.
Parameters

Name | Type | Description
--- | --- | ---
$baseDir | \PhingFile |

`setDestFile( \PhingFile $destFile ) :`
Set is the name/location of where to create the zip file.
Parameters

Name | Type | Description
--- | --- | ---
$destFile | \PhingFile | The output of the zip

`setIncludeEmptyDirs( boolean $bool ) : void`
Set the include empty dirs flag.
Parameters

Name | Type | Description
--- | --- | ---
$bool | boolean | Flag if empty dirs should be tarred too

Details

access
  public

`setPrefix( string $prefix ) : void`
Sets the file path prefix for file in the zip file.
Parameters

Name | Type | Description
--- | --- | ---
$prefix | string | Prefix

Documentation was generated by DocBlox 0.13.1.