# tasks/system/PhingTask.php

## \PhingReference
jump to top

Package: phing\tasks\system

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

Parent(s)
  \Reference

### Properties

`$refid= ''`
inherited Inherited from: \Reference::$refid
Details

Type
Inherited_from
  \Reference::$refid

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

Type

### Methods

`__construct( $id = null ) : void`
inherited

Inherited from: \Reference::__construct()
Parameters

Name | Type | Description
--- | --- | ---
$id |  |

`getRefId( ) : void`
inherited

Inherited from: \Reference::getRefId()
`getReferencedObject( $project ) : void`
inherited

returns reference to object in references container of project

Inherited from: \Reference::getReferencedObject()
Parameters

Name | Type | Description
--- | --- | ---
$project |  |

`getToRefid( ) : \the`

Get the id under which this reference will be stored in the new project

Returns

Type | Description
--- | ---
\the | id of the reference in the new project.

`setRefId( $id ) : void`
inherited

Inherited from: \Reference::setRefId()
Parameters

Name | Type | Description
--- | --- | ---
$id |  |

`setToRefid( \targetid $targetid ) : void`

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

Package: phing\tasks\system

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:

Parent(s)
  \Task < \ProjectComponent
Author
  Hans Lellelid
Copyright
  2001,2002 THYRELL. All rights reserved
Version
  $Revision: 1014 $

### Properties

`string $description= ''`
inherited

description of the taskInherited from: \Task::$description
Details

Type
  string
Inherited_from
  \Task::$description

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

`\Location $location= ''`
inherited

stored buildfile locationInherited from: \Task::$location
Details

Type
  \Location
Inherited_from
  \Task::$location

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

`\Project $project= 'null'`
inherited

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

A reference to the current project instanceInherited from: \ProjectComponent::$project
Default value `null` Details

Type
  \Project
Inherited_from
  \ProjectComponent::$project

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

`\Target $target= ''`
inherited

owning Target objectInherited from: \Task::$target
Details

Type
  \Target
Inherited_from
  \Task::$target

`string $taskName= ''`
inherited

Taskname for loggerInherited from: \Task::$taskName
Details

Type
  string
Inherited_from
  \Task::$taskName

`string $taskType= ''`
inherited

internal taskname (req)Inherited from: \Task::$taskType
Details

Type
  string
Inherited_from
  \Task::$taskType

`\RuntimeConfigurable $wrapper= ''`
inherited

wrapper of the taskInherited from: \Task::$wrapper
Details

Type
  \RuntimeConfigurable
Inherited_from
  \Task::$wrapper

### 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.

Throws

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

`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( ) : void`

Property to pass to the new project.

The property is passed as a 'user property'

Details

Access
  public

`createReference( ) : void`

Reference element identifying a data type to carry over to the new project.

Details

Access
  public

`getDescription( ) : string`
inherited

Returns the textual description of the task

Inherited from: \Task::getDescription()
Returns

Type | Description
--- | ---
string | The text description of the task

`getLocation( ) : \Location`
inherited

Returns the location within the buildfile this task occurs. Used by {@link BuildException} to give detailed error messages.

Inherited from: \Task::getLocation()
Returns

Type | Description
--- | ---
\Location | The location object describing the position of this task within the buildfile.

`getOwningTarget( ) : \Target`
inherited

Returns the owning target of this task.

Inherited from: \Task::getOwningTarget()
Returns

Type | Description
--- | ---
\Target | The target object that owns this task

`getProject( ) : \Project`
inherited

Returns a reference to current project

Inherited from: \ProjectComponent::getProject()
Returns

Type | Description
--- | ---
\Project | Reference to current porject object

`getRegisterSlot( $slotName ) : void`
inherited

Returns a name

Inherited from: \Task::getRegisterSlot()
Parameters

Name | Type | Description
--- | --- | ---
$slotName |  |

`getRuntimeConfigurableWrapper( ) : \RuntimeConfigurable`
inherited

Returns the wrapper object for runtime configuration

Inherited from: \Task::getRuntimeConfigurableWrapper()
Returns

Type | Description
--- | ---
\RuntimeConfigurable | The wrapper object used by this task

`getTaskName( ) : string`
inherited

Returns the name of task, used only for log messages

Inherited from: \Task::getTaskName()
Returns

Type | Description
--- | ---
string | Name of this task

`getTaskType( ) : string`
inherited

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

Inherited from: \Task::getTaskType()
Returns

Type | Description
--- | ---
string | The type of this task (XML Tag)

`init( ) : void`

Creates a Project instance for the project to call.

Should throw a BuildException if something goes wrong with the build

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

Throws

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

`initializeProject( ) : void`

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

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

Provides a project level log event to the task.

Inherited from: \Task::log()

@param string $msg The message to be logged.

Parameters

Name | Type | Description
--- | --- | ---
$msg | string | The message to log
$level | integer | The priority of the message

Details

See
  \BuildEvent
See
  \BuildListener

`main( ) : void`

Main entry point for the task.

Should throw a BuildException if someting goes wrong with the build

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

`maybeConfigure( ) : void`
inherited

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

Inherited from: \Task::maybeConfigure()
`overrideProperties( ) : void`

Override the properties in the new project with the one explicitly defined as nested elements here.

Throws

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

`perform( ) : void`
inherited

Perfrom this task

Inherited from: \Task::perform()
`processFile( ) : void`

Execute phing file.

`reinit( ) : void`

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 ) : void`

Alias function for setPhingfile

Parameters

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

Details

Access
  public

`setDescription( string $desc ) : void`
inherited

Sets a textual description of the task

Inherited from: \Task::setDescription()
Parameters

Name | Type | Description
--- | --- | ---
$desc | string | The text describing the task

`setDir( $d ) : void`

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 ) : void`

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 ) : void`

If true, pass all properties to the new phing project.

Defaults to true.

Parameters

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

Details

Access
  public

`setInheritRefs( $value ) : void`

If true, pass all references to the new phing project.

Defaults to false.

Parameters

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

Details

Access
  public

`setLocation( \Location $location ) : void`
inherited

Sets the location within the buildfile this task occurs. Called by the parser to set location information.

Inherited from: \Task::setLocation()
Parameters

Name | Type | Description
--- | --- | ---
$location | \Location | The location object describing the position of this task within the buildfile.

`setOwningTarget( \Target $target ) : void`
inherited

Sets the owning target this task belongs to.

Inherited from: \Task::setOwningTarget()
Parameters

Name | Type | Description
--- | --- | ---
$target | \Target | Reference to owning target

`setPhingfile( $s ) : void`

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

`setProject( \Project $project ) : void`
inherited

References the project to the current component.

Inherited from: \ProjectComponent::setProject()
Parameters

Name | Type | Description
--- | --- | ---
$project | \Project | The reference to the current project

`setRuntimeConfigurableWrapper( \RuntimeConfigurable $wrapper ) : void`
inherited

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

Inherited from: \Task::setRuntimeConfigurableWrapper()
Parameters

Name | Type | Description
--- | --- | ---
$wrapper | \RuntimeConfigurable | The wrapper object this task should use

`setTarget( $s ) : void`

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

`setTaskName( $name ) : string`
inherited

Sets the name of this task for log messages

Inherited from: \Task::setTaskName()
Parameters

Name | Type | Description
--- | --- | ---
$name |  |

Returns

Type | Description
--- | ---
string | A string representing the name of this task for log

`setTaskType( string $name ) : void`
inherited

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

Inherited from: \Task::setTaskType()
Parameters

Name | Type | Description
--- | --- | ---
$name | string | The type of this task (XML Tag)

Documentation was generated by DocBlox 0.15.1.