classes/phing/tasks/system/DeleteTask.php

Deletes a file or directory, or set of files defined by a fileset.

package
phing.tasks.system
version
$Revision: 552 $

\DeleteTask

Deletes a file or directory, or set of files defined by a fileset.

Use {@link Project#createTask} to register a new Task.

Extends from
\Task
author
Andreas Aderhold
copyright
2001,2002 THYRELL. All rights reserved
package
phing.tasks.system
version
$Revision: 552 $

Properties

Propertyprotected  $dir= ''
Details
Type
Propertyprotected  $failonerror= 'true'
Default valuetrueDetails
Type
Propertyprotected  $file= ''
Details
Type
Propertyprivate  $filelists= 'array'

Any filelists of files that should be deleted.

Default valuearrayDetails
Type
Propertyprotected  $filesets= 'array'
Default valuearrayDetails
Type
Propertyprotected  $includeEmpty= 'false'
Default valuefalseDetails
Type
Propertyprotected  $quiet= 'false'
Default valuefalseDetails
Type
Propertyprotected  $verbosity= 'Project'
Default valueProjectDetails
Type

Methods

methodpublic  createFileList( ) :
Nested creator, adds a set of files (nested fileset attribute).
methodpublic  createFileSet( ) :
Nested creator, adds a set of files (nested fileset attribute).
methodpublic  main( ) :
Delete the file(s).
methodprivate  removeDir( \PhingFile $d ) :
Recursively removes a directory.
Parameters
Name Type Description
$d \PhingFile The directory to remove.
methodprivate  removeFiles( \PhingFile $d, array $files, array $dirs ) :
remove an array of files in a directory, and a list of subdirectories which will only be deleted if 'includeEmpty' is true
Parameters
Name Type Description
$d \PhingFile directory to work from
$files array

&$files array of files to delete; can be of zero length

$dirs array

&$dirs array of directories to delete; can of zero length

methodpublic  setDir( \PhingFile $dir ) :
Set the directory from which files are to be deleted.
Parameters
Name Type Description
$dir \PhingFile
methodpublic  setFailOnError(  $bool ) :
this flag means 'note errors to the output, but keep going'
Parameters
Name Type Description
$bool
methodpublic  setFile( \PhingFile $file ) :
Set the name of a single file to be removed.
Parameters
Name Type Description
$file \PhingFile
methodpublic  setIncludeEmptyDirs(  $includeEmpty ) :
Used to delete empty directories.
Parameters
Name Type Description
$includeEmpty
methodpublic  setQuiet(  $bool ) :
If the file does not exist, do not display a diagnostic message or modify the exit status to reflect an error.

This means that if a file or directory cannot be deleted, then no error is reported. This setting emulates the -f option to the Unix rm command. Default is false meaning things are verbose

Parameters
Name Type Description
$bool
methodpublic  setVerbose( boolean $verbosity ) :
Used to force listing of all names of deleted files.
Parameters
Name Type Description
$verbosity boolean
Documentation was generated by DocBlox 0.13.1.