classes/phing/Task.php

\Task

The base class for all Tasks.

Use {@link Project#createTask} to register a new Task.

Extends from
\ProjectComponent
see
\Project#createTask()
author
Andreas Aderhold
copyright
2001,2002 THYRELL. All rights reserved
package
phing
version
$Revision: 912 $

Properties

Propertyprotectedstring  $description= ''

description of the task
Details
Type
string
Propertyprotected\Location  $location= ''

stored buildfile location
Details
Type
\Location
Propertyprotected\Target  $target= ''

owning Target object
Details
Type
\Target
Propertyprotectedstring  $taskName= ''

Taskname for logger
Details
Type
string
Propertyprotectedstring  $taskType= ''

internal taskname (req)
Details
Type
string
Propertyprotected\RuntimeConfigurable  $wrapper= ''

wrapper of the task
Details
Type
\RuntimeConfigurable

Methods

methodpublic  getDescription( ) : string
Returns the textual description of the task
Returns
Type Description
string
methodpublic  getLocation( ) : \Location
Returns the location within the buildfile this task occurs. Used by {@link BuildException} to give detailed error messages.
Returns
Type Description
\Location
methodpublic  getOwningTarget( ) : \Target
Returns the owning target of this task.
Returns
Type Description
\Target
methodprotected  getRegisterSlot(  $slotName ) :
Returns a name
Parameters
Name Type Description
$slotName
methodpublic  getRuntimeConfigurableWrapper( ) : \RuntimeConfigurable
Returns the wrapper object for runtime configuration
Returns
Type Description
\RuntimeConfigurable
methodpublic  getTaskName( ) : string
Returns the name of task, used only for log messages
Returns
Type Description
string
methodpublic  getTaskType( ) : string
Returns the name of the task under which it was invoked, usually the XML tagname
Returns
Type Description
string
methodpublic  init( ) :
Called by the parser to let the task initialize properly.

Should throw a BuildException if something goes wrong with the build

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

Details
throws
methodpublic  log( string $msg, integer $level = Project ) :
Provides a project level log event to the task.
Parameters
Name Type Description
$msg string The message to log
$level integer The priority of the message
Details
see
\BuildEvent
see
\BuildListener
methodpublic  main( ) :
abstractCalled by the project to let the task do it's work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running phing target1 target2 will run all tasks in target3 twice.

Should throw a BuildException if someting goes wrong with the build

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

methodpublic  maybeConfigure( ) :
Configure this task if it hasn't been done already.
methodpublic  perform( ) :
Perfrom this task
methodpublic  setDescription( string $desc ) :
Sets a textual description of the task
Parameters
Name Type Description
$desc string The text describing the task
methodpublic  setLocation( \Location $location ) :
Sets the location within the buildfile this task occurs. Called by the parser to set location information.
Parameters
Name Type Description
$location \Location The location object describing the position of this task within the buildfile.
methodpublic  setOwningTarget( \Target $target ) :
Sets the owning target this task belongs to.
Parameters
Name Type Description
$target \Target Reference to owning target
methodpublic  setRuntimeConfigurableWrapper( \RuntimeConfigurable $wrapper ) :
Sets the wrapper object this task should use for runtime configurable elements.
Parameters
Name Type Description
$wrapper \RuntimeConfigurable The wrapper object this task should use
methodpublic  setTaskName(  $name ) : string
Sets the name of this task for log messages
Parameters
Name Type Description
$name
Returns
Type Description
string
methodpublic  setTaskType( string $name ) :
Sets the type of the task. Usually this is the name of the XML tag
Parameters
Name Type Description
$name string

The type of this task (XML Tag)

Documentation was generated by DocBlox 0.13.1.