ZipTask

Extends \MatchingTask

Creates a zip archive using PHP ZipArchive extension/

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

author

Michiel Rook [email protected]

version

$Id: cdeacd2f7bfabfa11bab38c9d0b203efdba0a04e $

package

phing.tasks.ext

since 2.1.0

Methods

__construct

__construct() 
inherited

add an "And" selector entry on the selector list

addAnd(\AndSelector $selector) : \AndSelector
inherited

Arguments

$selector

\AndSelector

Response

\AndSelector

add a contains selector entry on the selector list

addContains(\ContainsSelector $selector) 
inherited

Arguments

$selector

\ContainsSelector

add a contains selector entry on the selector list

addContainsRegexp(\ContainsRegexpSelector $selector) 
inherited

Arguments

add an extended selector entry on the selector list

addCustom(\ExtendSelector $selector) : \ExtendSelector
inherited

Arguments

$selector

\ExtendSelector

Response

\ExtendSelector

add a selector date entry on the selector list

addDate(\DateSelector $selector) : \DateSelector
inherited

Arguments

$selector

\DateSelector

Response

\DateSelector

add a depends selector entry on the selector list

addDepend(\DependSelector $selector) 
inherited

Arguments

$selector

\DependSelector

add a depth selector entry on the selector list

addDepth(\DepthSelector $selector) 
inherited

Arguments

$selector

\DepthSelector

add a different selector entry on the selector list

addDifferent(\DifferentSelector $selector) 
inherited

Arguments

$selector

\DifferentSelector

add a executable selector entry on the selector list

addExecutable(\ExecutableSelector $selector) 
inherited

Arguments

add a selector filename entry on the selector list

addFilename(\FilenameSelector $selector) : \FilenameSelector
inherited

Arguments

$selector

\FilenameSelector

Response

\FilenameSelector

addFilesetsToArchive

addFilesetsToArchive( $zip) 

Arguments

$zip

add a majority selector entry on the selector list

addMajority(\MajoritySelector $selector) : \MajoritySelector
inherited

Arguments

$selector

\MajoritySelector

Response

\MajoritySelector

add a "None" selector entry on the selector list

addNone(\NoneSelector $selector) : \NoneSelector
inherited

Arguments

$selector

\NoneSelector

Response

\NoneSelector

add a "Not" selector entry on the selector list

addNot(\NotSelector $selector) : \NotSelector
inherited

Arguments

$selector

\NotSelector

Response

\NotSelector

add an "Or" selector entry on the selector list

addOr(\OrSelector $selector) : \OrSelector
inherited

Arguments

$selector

\OrSelector

Response

\OrSelector

add a present selector entry on the selector list

addPresent(\PresentSelector $selector) 
inherited

Arguments

$selector

\PresentSelector

add a readable selector entry on the selector list

addReadable(\ReadableSelector $selector) 
inherited

Arguments

$selector

\ReadableSelector

add a "Select" selector entry on the selector list

addSelector(\SelectSelector $selector) : \SelectSelector
inherited

Arguments

$selector

\SelectSelector

Response

\SelectSelector

add a selector size entry on the selector list

addSize(\SizeSelector $selector) : \SizeSelector
inherited

Arguments

$selector

\SizeSelector

Response

\SizeSelector

add a type selector entry on the selector list

addType(\TypeSelector $selector) 
inherited

Arguments

$selector

\TypeSelector

add a writable selector entry on the selector list

addWritable(\WritableSelector $selector) 
inherited

Arguments

$selector

\WritableSelector

Add a new fileset.

addZipFileSet(\ZipFileSet $fileset) 

Arguments

$fileset

\ZipFileSet

Add a new selector into this container.

appendSelector(\FileSelector $selector) : void
inherited

Arguments

$selector

\FileSelector

the new selector to add

archiveIsUpToDate

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

Arguments

$files

array

array of filenames

$dir

\PhingFile

Response

boolean

areFilesetsUpToDate

areFilesetsUpToDate() : array
Throws
\BuildException

Response

array

add a name entry on the exclude list

createExclude() : \PatternSetNameEntry
inherited

add a name entry on the include files list

createExcludesFile() : \PatternSetNameEntry
inherited

Add a new fileset.

createFileSet() : \ZipFileSet

Response

\ZipFileSet

add a name entry on the include list

createInclude() : \PatternSetNameEntry
inherited

add a name entry on the include files list

createIncludesFile() : \PatternSetNameEntry
inherited

add a set of patterns

createPatternSet() : \PatternSet
inherited

Response

\PatternSet

Returns the description of the current action.

getDescription() : string
inherited

Response

string

the description of the current action, or null if no description is available.

Returns the directory scanner needed to access the files to process.

getDirectoryScanner(\PhingFile $baseDir) : \DirectoryScanner
inherited
Throws
\BuildException

Arguments

$baseDir

\PhingFile

Response

\DirectoryScanner

Accessor for the implict fileset.

getImplicitFileSet() : \FileSet
inherited final

Response

\FileSet

Returns the file/location where this task was defined.

getLocation() : \Location
inherited

Response

\Location

the file/location where this task was defined. Should not return null.

Returns the owning target of this task.

getOwningTarget() : \Target
inherited

Response

\Target

The target object that owns this task

Returns a reference to current project

getProject() : \Project
inherited

Response

\Project

Reference to current porject object

Returns a name

getRegisterSlot(string $slotName) : \RegisterSlot
inherited

Arguments

$slotName

string

Response

\RegisterSlot

Returns the wrapper object for runtime configuration

getRuntimeConfigurableWrapper() : \RuntimeConfigurable
inherited

Response

\RuntimeConfigurable

The wrapper object used by this task

Returns the set of selectors as an array.

getSelectors(\Project $p) : array
inherited

Arguments

Response

array

FileSelector[] An array of selectors in this container

Returns the name of task, used only for log messages

getTaskName() : string
inherited

Response

string

Name of this task

Returns the name of the task under which it was invoked, usually the XML tagname

getTaskType() : string
inherited

Response

string

The type of this task (XML Tag)

Indicates whether there are any selectors here.

hasSelectors() : boolean
inherited

Response

boolean

Whether any selectors are in this container

Called by the parser to let the task initialize properly.

init() 
inherited

Should throw a BuildException if something goes wrong with the build

This is abstract here, but may not be overloaded by subclasses.

Throws
\BuildException

Logs a message with the given priority.

log(string $msg, integer $level = \Project::MSG_INFO) : void
inherited

Arguments

$msg

string

The message to be logged.

$level

integer

The message's priority at this message should have

Called by the project to let the task do it's work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running <em>phing target1 target2</em> will run all tasks in target3 twice.

main() 
inherited abstract

Should throw a BuildException if someting goes wrong with the build

This is abstract here. Must be overloaded by real tasks.

Configure this task if it hasn't been done already.

maybeConfigure() 
inherited

Perfrom this task

perform() : void
inherited
Throws
\BuildException
\Error

Gives the count of the number of selectors in this container

selectorCount() : integer
inherited

Response

integer

The number of selectors in this container

Returns an enumerator for accessing the set of selectors.

selectorElements() : array
inherited

Response

array

an enumerator that goes through each of the selectors

This is the base directory to look in for things to zip.

setBasedir(\PhingFile $baseDir) 

Arguments

$baseDir

\PhingFile

Sets case sensitivity of the file system

setCaseSensitive(boolean $isCaseSensitive) : void
inherited

Arguments

$isCaseSensitive

boolean

"true"|"on"|"yes" if file system is case sensitive, "false"|"off"|"no" when not.

Add a comment to the zip archive.

setComment(string $text) : void

Arguments

$text

string

Sets whether default exclusions should be used or not.

setDefaultexcludes(boolean $useDefaultExcludes) 
inherited

Arguments

$useDefaultExcludes

boolean

"true"|"on"|"yes" when default exclusions should be used, "false"|"off"|"no" when they shouldn't be used.

Sets a description of the current action. This may be used for logging purposes.

setDescription(string $desc) 
inherited

Arguments

$desc

string

Description of the current action. May be null, indicating that no description is available.

Set is the name/location of where to create the zip file.

setDestFile(\PhingFile $destFile) 

Arguments

$destFile

\PhingFile

The output of the zip

Sets the set of exclude patterns. Patterns may be separated by a comma or a space.

setExcludes(string $excludes) 
inherited

Arguments

$excludes

string

the string containing the exclude patterns

Sets the name of the file containing the includes patterns.

setExcludesfile(\PhingFile $excludesfile) : void
inherited

Arguments

$excludesfile

\PhingFile

A string containing the filename to fetch the include patterns from.

Set the include empty dirs flag.

setIncludeEmptyDirs( $bool) : void

Arguments

$bool

Sets the set of include patterns. Patterns may be separated by a comma or a space.

setIncludes(string $includes) : void
inherited

Arguments

$includes

string

the string containing the include patterns

Sets the name of the file containing the includes patterns.

setIncludesfile(\PhingFile $includesfile) : void
inherited

Arguments

$includesfile

\PhingFile

A string containing the filename to fetch the include patterns from.

Sets the file/location where this task was defined.

setLocation(\Location $location) 
inherited

Arguments

$location

\Location

The file/location where this task was defined. Should not be null

Sets the owning target this task belongs to.

setOwningTarget(\Target $target) 
inherited

Arguments

$target

\Target

Sets the file path prefix for file in the zip file.

setPrefix(string $prefix) : void

Arguments

$prefix

string

Prefix

References the project to the current component.

setProject(\Project $project) : void
inherited

Arguments

$project

\Project

The reference to the current project

Sets the wrapper object this task should use for runtime configurable elements.

setRuntimeConfigurableWrapper(\RuntimeConfigurable $wrapper) 
inherited

Arguments

$wrapper

\RuntimeConfigurable

The wrapper object this task should use

Sets the name of this task for log messages

setTaskName(string $name) 
inherited

Arguments

$name

string

Sets the type of the task. Usually this is the name of the XML tag

setTaskType(string $name) 
inherited

Arguments

$name

string

The type of this task (XML Tag)

Properties

zipFile

zipFile : \PhingFile
var

Type(s)

\PhingFile

baseDir

baseDir : \PhingFile
var

Type(s)

\PhingFile

Whether to include empty dirs in the archive.

includeEmpty : 

Type(s)

filesets

filesets : 

Type(s)

File path prefix in zip archive

prefix : string
var

Type(s)

string

Comment for zip archive.

comment : string
var

Type(s)

string

useDefaultExcludes

useDefaultExcludes : boolean
inherited
var

Type(s)

boolean

fileset

fileset : \FileSet
inherited
var

Type(s)

\FileSet

Owning Target object

target : \Target
inherited
var

Type(s)

\Target

Internal taskname (req)

taskType : string
inherited
var

Type(s)

string

Taskname for logger

taskName : string
inherited
var

Type(s)

string

Wrapper of the task

wrapper : \RuntimeConfigurable
inherited
var

Type(s)

\RuntimeConfigurable

Holds a reference to the project that a project component (a task, a target, etc.) belongs to

project : \Project
inherited
var

A reference to the current project instance

Type(s)

\Project

location

location : \Location
inherited
var

Type(s)

\Location

description

description : string
inherited
var

Type(s)

string