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

## \PhingReference
jump to top

Helper class that implements the nested <reference> element of <phing> and <phingcall>.

Extends from
  \Reference
package
  phing.tasks.system

### Properties

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

Type

### Methods

`getToRefid( ) : \the`
Get the id under which this reference will be stored in the new project
Returns

Type | Description
--- | ---
\the |

`setToRefid( \targetid $targetid ) :`
Set the id that this reference to be stored under in the new project.
Parameters

Name | Type | Description
--- | --- | ---
$targetid | \targetid | the id under which this reference will be passed to the new project

## \PhingTask
jump to top

Task that invokes phing on another build file.

Use this task, for example, if you have nested buildfiles in your project. Unlike AntTask, PhingTask can even support filesets:

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

### Properties

`$dir= ''`

the basedir where is executed the build file

Details

Type

`$filesets= 'array'`

The filesets that contain the files PhingTask is to be run on.

Default value `array` Details

Type

`$haltOnFailure= 'false'`

Fail the build process when the called build fails?

Default value `false` Details

Type

`$inheritAll= 'true'`

should we inherit properties from the parent ?

Default value `true` Details

Type

`$inheritRefs= 'false'`

should we inherit references from the parent ?

Default value `false` Details

Type

`$newProject= ''`

the temporary project created to run the build file

Details

Type

`$newTarget= ''`

the target to call if any

Details

Type

`$phingFile= ''`

build.xml (can be absolute) in this case dir will be ignored

Details

Type

`$properties= 'array'`

the properties to pass to the new project

Default value `array` Details

Type

`$references= 'array'`

the references to pass to the new project

Default value `array` Details

Type

### Methods

`addReferences( ) : void`
Add the references explicitly defined as nested elements to the new project. Also copy over all references that don't override existing references in the new project if inheritrefs has been requested.
Details

throws

`copyReference( string $oldKey, string $newKey ) : void`
Try to clone and reconfigure the object referenced by oldkey in the parent project and add it to the new project with the key newkey.

If we cannot clone it, copy the referenced object itself and keep our fingers crossed.

Parameters

Name | Type | Description
--- | --- | ---
$oldKey | string |
$newKey | string |

`createFileSet( ) : \FileSet`
Support for filesets; This method returns a reference to an instance of a FileSet object.
Returns

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

`createProperty( ) :`
Property to pass to the new project.

The property is passed as a 'user property'

Details

access
  public

`createReference( ) :`
Reference element identifying a data type to carry over to the new project.
Details

access
  public

`init( ) : void`
Creates a Project instance for the project to call.
`initializeProject( ) :`
Configure the Project, i.e. make intance, attach build listeners (copy from father project), add Task and Datatype definitions, copy properties and references from old project if these options are set via the attributes of the XML tag.

Developer note: This function replaces the old methods "init", "_reinit" and "_initializeProject".

Details

access
  protected

`main( ) : void`
Main entry point for the task.
`overrideProperties( ) : void`
Override the properties in the new project with the one explicitly defined as nested elements here.
Details

throws

`processFile( ) : void`
Execute phing file.
`reinit( ) :`
Called in execute or createProperty if newProject is null.

This can happen if the same instance of this task is run twice as newProject is set to null at the end of execute (to save memory and help the GC).

Sets all properties that have been defined as nested property elements.

`setBuildfile( $s ) :`
Alias function for setPhingfile
Parameters

Name | Type | Description
--- | --- | ---
$s |  |

Details

access
  public

`setDir( $d ) :`
The directory to use as a base directory for the new phing project.

Defaults to the current project's basedir, unless inheritall has been set to false, in which case it doesn't have a default value. This will override the basedir setting of the called project.

Parameters

Name | Type | Description
--- | --- | ---
$d |  |

Details

access
  public

`setHaltOnFailure( boolean $hof ) :`
If true, abort the build process if there is a problem with or in the target build file.

Defaults to false.

Parameters

Name | Type | Description
--- | --- | ---
$hof | boolean | new value

`setInheritAll( $value ) :`
If true, pass all properties to the new phing project.

Defaults to true.

Parameters

Name | Type | Description
--- | --- | ---
$value |  |

Details

access
  public

`setInheritRefs( $value ) :`
If true, pass all references to the new phing project.

Defaults to false.

Parameters

Name | Type | Description
--- | --- | ---
$value |  |

Details

access
  public

`setPhingfile( $s ) :`
The build file to use.

Defaults to "build.xml". This file is expected to be a filename relative to the dir attribute given.

Parameters

Name | Type | Description
--- | --- | ---
$s |  |

Details

access
  public

`setTarget( $s ) :`
The target of the new Phing project to execute.

Defaults to the new project's default target.

Parameters

Name | Type | Description
--- | --- | ---
$s |  |

Details

access
  public

Documentation was generated by DocBlox 0.13.1.