# classes/phing/tasks/system/ForeachTask.php

## \ForeachTask
jump to top

<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 ",".

Extends from
  \Task
author
  Jason Hines
author
  Hans Lellelid
copyright
  2001,2002 THYRELL. All rights reserved
package
  phing.tasks.system
version
  $Revision: 1243 $

### Properties

`$absparam= ''`

Name of absolute path parameter to pass to callee

Details

Type

`\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

`array $filelists= 'array'`

Array of filelists

Default value `array` Details

Type
  array

`$filesets= 'array'`

Array of filesets

Default value `array` Details

Type

`$list= ''`

Delimter-separated list of values to process.

Details

Type

`$param= ''`

Name of parameter to pass to callee

Details

Type

`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 <filelist> element.
Returns

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

`createFileSet( ) :`
Nested creator, adds a set of files (nested fileset attribute).
`createProperty( ) : \Property`
Returns

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

`init( ) :`
`main( ) : void`
This method does the work.
`process( \Task $callee, \PhingFile $fromDir, array $srcFiles, array $srcDirs ) :`
Processes a list of files & directories
Parameters

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

`setAbsparam( $absparam ) :`
Parameters

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

`setDelimiter( $delimiter ) :`
Parameters

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

`setList( $list ) :`
Parameters

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

`setParam( $param ) :`
Parameters

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

`setTarget( $target ) :`
Parameters

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

Documentation was generated by DocBlox 0.13.1.