# tasks/system/ForeachTask.php

## \ForeachTask
jump to top

Package: phing\tasks\system

<foreach> task

Task definition for the foreach task. This task takes a list with delimited values, and executes a target with set param.

Usage:

Attributes: list --> The list of values to process, with the delimiter character, indicated by the "delimiter" attribute, separating each value. target --> The target to call for each token, passing the token as the parameter with the name indicated by the "param" attribute. param --> The name of the parameter to pass the tokens in as to the target. delimiter --> The delimiter string that separates the values in the "list" parameter. The default is ",".

Parent(s)
  \Task < \ProjectComponent
Author
  Jason Hines
Author
  Hans Lellelid
Version
  $Revision: 1331 $

### Properties

`$absparam= ''`

Name of absolute path parameter to pass to callee

Details

Type
  n/a

`\PhingCallTask $callee= ''`

PhingCallTask that will be invoked w/ calleeTarget.

Details

Type
  \PhingCallTask

`string $calleeTarget= ''`

Target to execute.

Details

Type
  string

`$delimiter= '',''`

Delimiter that separates items in $list

Default value`','`Details

Type
  n/a

`array $filelists= 'array()'`

Array of filelists

Default value `array()`Details

Type
  array

`$filesets= 'array()'`

Array of filesets

Default value `array()`Details

Type
  n/a

`$list= ''`

Delimter-separated list of values to process.

Details

Type
  n/a

`$mapperElement= ''`

Instance of mapper *

Details

Type
  n/a

`$param= ''`

Name of parameter to pass to callee

Details

Type
  n/a

`integer $total_dirs= '0'`

Total number of directories processed

Default value `0` Details

Type
  integer

`integer $total_files= '0'`

Total number of files processed

Default value `0` Details

Type
  integer

### Methods

`createFileList( ) : \FileList`

Supports embedded element.

Returns

Type | Description
--- | ---
\FileList |

`createFileSet( ) : void`

Nested creator, adds a set of files (nested fileset attribute).

`createMapper( ) : object`

Nested creator, creates one Mapper for this task

Returns

Type | Description
--- | ---
object | The created Mapper type object

Throws

Exception | Description
--- | ---
\BuildException |

Details

Access
  public

`createProperty( ) : \Property`

Returns

Type | Description
--- | ---
\Property |

`getDescription( ) : void`

`getLocation( ) : void`

`getOwningTarget( ) : void`

`getProject( ) : void`

`getRegisterSlot( ) : void`

`getRuntimeConfigurableWrapper( ) : void`

`getTaskName( ) : void`

`getTaskType( ) : void`

`init( ) : void`

`log( ) : void`

`main( ) : void`

This method does the work.

`maybeConfigure( ) : void`

`perform( ) : void`

`process( \Task $callee, \PhingFile $fromDir, array $srcFiles, array $srcDirs ) : void`

Processes a list of files & directories

Parameters

Name | Type | Description
--- | --- | ---
$callee | \Task |
$fromDir | \PhingFile |
$srcFiles | array |
$srcDirs | array |

`setAbsparam( $absparam ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$absparam |  |

`setDelimiter( $delimiter ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$delimiter |  |

`setDescription( ) : void`

`setList( $list ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$list |  |

`setLocation( ) : void`

`setOwningTarget( ) : void`

`setParam( $param ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$param |  |

`setProject( ) : void`

`setRuntimeConfigurableWrapper( ) : void`

`setTarget( $target ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$target |  |

`setTaskName( ) : void`

`setTaskType( ) : void`

Documentation was generated by DocBlox 0.17.1.