tasks/system/PhingTask.php

Show: inherited
Table of Contents

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:

  
   
      
     
   
  
Author
Hans Lellelid  
Package
phing.tasks.system  
Version
$Id: 2eec26f6ebaaeceb4eca76644de88bde7515f5dc $  

\PhingReference

Package: phing\tasks\system

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

Parent(s)
\Reference

Properties

Propertyprotected  $refid= ''
inheritedInherited from: \Reference::$$refid
Details
Type
n/a
Inherited_from
\Reference::$$refid  
Propertyprivate  $targetid= 'null'
Default valuenullDetails
Type
n/a

Methods

methodpublic__construct(  $id = null ) : void
inherited

Inherited from: \Reference::__construct()
Parameters
Name Type Description
$id
methodpublicgetRefId( ) : void
inherited

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

returns reference to object in references container of project

Inherited from: \Reference::getReferencedObject()
Parameters
Name Type Description
$project
methodpublicgetToRefid( ) : \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.
methodpublicsetRefId(  $id ) : void
inherited

Inherited from: \Reference::setRefId()
Parameters
Name Type Description
$id
methodpublicsetToRefid( \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

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
$Id: 2eec26f6ebaaeceb4eca76644de88bde7515f5dc $  

Properties

Propertyprotectedstring  $description= ''
inherited

Description of the task

Inherited from: \Task::$$description
Details
Type
string
Inherited_from
\Task::$$description  
Propertyprivate  $dir= ''

the basedir where is executed the build file

Details
Type
n/a
Propertyprivate  $filesets= 'array()'

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

Default valuearray()Details
Type
n/a
Propertyprivate  $haltOnFailure= 'false'

Fail the build process when the called build fails?

Default valuefalseDetails
Type
n/a
Propertyprivate  $inheritAll= 'true'

should we inherit properties from the parent ?

Default valuetrueDetails
Type
n/a
Propertyprivate  $inheritRefs= 'false'

should we inherit references from the parent ?

Default valuefalseDetails
Type
n/a
Propertyprotected\Location  $location= ''
inherited

Stored buildfile location

Inherited from: \Task::$$location
Details
Type
\Location
Inherited_from
\Task::$$location  
Propertyprivate  $newProject= ''

the temporary project created to run the build file

Details
Type
n/a
Propertyprotected  $newTarget= ''

the target to call if any

Details
Type
n/a
Propertyprivate  $phingFile= ''

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

Details
Type
n/a
Propertyprotected\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\Task::$$project
Default valuenullDetails
Type
\Project
Inherited_from
\ProjectComponent::$$project  
Inherited_from
\Task::$$project  
Propertyprivate  $properties= 'array()'

the properties to pass to the new project

Default valuearray()Details
Type
n/a
Propertyprivate  $references= 'array()'

the references to pass to the new project

Default valuearray()Details
Type
n/a
Propertyprotected\Target  $target= ''
inherited

Owning Target object

Inherited from: \Task::$$target
Details
Type
\Target
Inherited_from
\Task::$$target  
Propertyprotectedstring  $taskName= ''
inherited

Taskname for logger

Inherited from: \Task::$$taskName
Details
Type
string
Inherited_from
\Task::$$taskName  
Propertyprotectedstring  $taskType= ''
inherited

Internal taskname (req)

Inherited from: \Task::$$taskType
Details
Type
string
Inherited_from
\Task::$$taskType  
Propertyprotected\RuntimeConfigurable  $wrapper= ''
inherited

Wrapper of the task

Inherited from: \Task::$$wrapper
Details
Type
\RuntimeConfigurable
Inherited_from
\Task::$$wrapper  

Methods

methodprivateaddReferences( ) : 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
methodprivatecopyReference( 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
methodpubliccreateFileSet( ) : \FileSet

Support for filesets; This method returns a reference to an instance of a FileSet object.

Returns
Type Description
\FileSet
methodpubliccreateProperty( ) : void

Property to pass to the new project.

The property is passed as a 'user property'

Details
Access
public  
methodpubliccreateReference( ) : void

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

Details
Access
public  
methodpublicgetDescription( ) : string
inherited

Returns the textual description of the task

Inherited from: \Task::getDescription()
Returns
Type Description
string The text description of the task
methodpublicgetLocation( ) : \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.
methodpublicgetOwningTarget( ) : \Target
inherited

Returns the owning target of this task.

Inherited from: \Task::getOwningTarget()
Returns
Type Description
\Target The target object that owns this task
methodpublicgetProject( ) : \Project
inherited

Returns a reference to current project

Inherited from: \ProjectComponent::getProject()\Task::getProject()
Returns
Type Description
\Project Reference to current porject object
methodprotectedgetRegisterSlot( string $slotName ) : void
inherited

Returns a name

Inherited from: \Task::getRegisterSlot()
Parameters
Name Type Description
$slotName string
methodpublicgetRuntimeConfigurableWrapper( ) : \RuntimeConfigurable
inherited

Returns the wrapper object for runtime configuration

Inherited from: \Task::getRuntimeConfigurableWrapper()
Returns
Type Description
\RuntimeConfigurable The wrapper object used by this task
methodpublicgetTaskName( ) : string
inherited

Returns the name of task, used only for log messages

Inherited from: \Task::getTaskName()
Returns
Type Description
string Name of this task
methodpublicgetTaskType( ) : 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)
methodpublicinit( ) : 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
methodprivateinitializeProject( ) : 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  
methodpubliclog( string $msg, integer $level = Project::MSG_INFO ) : void
inherited

Provides a project level log event to the task.

Inherited from: \Task::log()
Parameters
Name Type Description
$msg string

The message to log

$level integer

The priority of the message

Details
See
\BuildEvent  
See
\BuildListener  
methodpublicmain( ) : 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.

methodpublicmaybeConfigure( ) : void
inherited

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

Inherited from: \Task::maybeConfigure()
methodprivateoverrideProperties( ) : void

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

Throws
Exception Description
\BuildException
methodpublicperform( ) : void
inherited

Perfrom this task

Inherited from: \Task::perform()
methodprivateprocessFile( ) : void

Execute phing file.

methodprivatereinit( ) : 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.

methodpublicsetBuildfile(  $s ) : void

Alias function for setPhingfile

Parameters
Name Type Description
$s
Details
Access
public  
methodpublicsetDescription( 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

methodpublicsetDir(  $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  
methodpublicsetHaltOnFailure( 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

methodpublicsetInheritAll(  $value ) : void

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

Defaults to true.

Parameters
Name Type Description
$value
Details
Access
public  
methodpublicsetInheritRefs(  $value ) : void

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

Defaults to false.

Parameters
Name Type Description
$value
Details
Access
public  
methodpublicsetLocation( \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.

methodpublicsetOwningTarget( \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

methodpublicsetPhingfile(  $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  
methodpublicsetProject( \Project $project ) : void
inherited

References the project to the current component.

Inherited from: \ProjectComponent::setProject()\Task::setProject()
Parameters
Name Type Description
$project \Project

The reference to the current project

methodpublicsetRuntimeConfigurableWrapper( \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

methodpublicsetTarget(  $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  
methodpublicsetTaskName( string $name ) : string
inherited

Sets the name of this task for log messages

Inherited from: \Task::setTaskName()
Parameters
Name Type Description
$name string
Returns
Type Description
string A string representing the name of this task for log
methodpublicsetTaskType( 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.18.1.