# tasks/ext/rSTTask.php

reStructuredText rendering task for Phing, the PHP build tool.

PHP version 5

Author
  Christian Weiske
Category
  Tasks
License
  LGPL v3 or later http://www.gnu.org/licenses/lgpl.html
Link
  https://gitorious.org/phing/rsttask
Package
  phing.tasks.ext
Version
  SVN: $Id: rSTTask.php 1304 2011-09-25 15:39:30Z mrook $

## \rSTTask
jump to top

Package: phing\tasks\ext

reStructuredText rendering task for Phing, the PHP build tool.

PHP version 5

Parent(s)
  \Task < \ProjectComponent
Author
  Christian Weiske
Category
  Tasks
Copyright
  2001,2002 THYRELL. All rights reserved
License
  LGPL v3 or later http://www.gnu.org/licenses/lgpl.html
Link
  https://gitorious.org/phing/rsttask
Version
  $Revision: 912 $

### Properties

`string $description= ''`
inherited

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

Type
  string
Inherited_from
  \Task::$description

`string $destination= 'null'`

Output file or directory. May be omitted.

When it ends with a slash, it is considered to be a directory

Default value `null` Details

Type
  string

`string $file= 'null'`

Input file in rST format.

Required

Default value `null` Details

Type
  string

`$filesets= 'array()'`
Default value `array()`Details

Type

`array $filterChains= 'array()'`

all filterchains objects assigned to this task

Default value `array()`Details

Type
  array

`string $format= ''html''`

Result format, defaults to "html".

Default value`'html'`Details

Type
  string
See
  \$supportedFormats

`\Location $location= ''`
inherited

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

Type
  \Location
Inherited_from
  \Task::$location

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

Type

`integer $mode= '0755'`

mode to create directories with

Default value `0755` Details

Type
  integer

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

`array $supportedFormats= 'array( 'html''`
static

Array of supported output formats

Default value `array( 'html'`Details

Type
  array
See
  \$format
See
  \$targetExt

`\Target $target= ''`
inherited

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

Type
  \Target
Inherited_from
  \Task::$target

`array $targetExt= 'array( 'html' => 'html''`
static

Maps formats to file extensions

Default value `array( 'html' => 'html'`Details

Type
  array

`string $taskName= ''rST''`
Taskname for logger

Default value`'rST'`Details

Type
  string

`string $taskType= ''`
inherited

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

Type
  string
Inherited_from
  \Task::$taskType

`string $toolParam= 'null'`

Additional rst2* tool parameters.

Default value `null` Details

Type
  string

`string $toolPath= 'null'`

Full path to the tool, i.e. /usr/local/bin/rst2html

Default value `null` Details

Type
  string

`boolean $uptodate= 'false'`

Only render files whole source files are newer than the target files

Default value `false` Details

Type
  boolean

`\RuntimeConfigurable $wrapper= ''`
inherited

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

Type
  \RuntimeConfigurable
Inherited_from
  \Task::$wrapper

### Methods

`createFileSet( ) : object`

Nested creator, creates a FileSet for this task

Returns

Type | Description
--- | ---
object | The created fileset object

`createFilterChain( ) : \FilterChain`

Creates a filterchain, stores and returns it

Returns

Type | Description
--- | ---
\FilterChain | The created filterchain object

`createMapper( ) : \Mapper`

Nested creator, creates one Mapper for this task

Returns

Type | Description
--- | ---
\Mapper | The created Mapper type object

Throws

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

`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

`getTargetFile( string $file, string $destination = null ) : string`

Determines and returns the target file name from the input file and the configured destination name.

Parameters

Name | Type | Description
--- | --- | ---
$file | string | Input file
$destination | string | Destination file or directory name, may be null

Returns

Type | Description
--- | ---
string | Target file name

Details

Uses
  \$format
Uses
  \$targetExt

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

`getToolPath( string $format ) : string`

Finds the rst2* binary path

Parameters

Name | Type | Description
--- | --- | ---
$format | string | Output format

Returns

Type | Description
--- | ---
string | Full path to rst2$format

Throws

Exception | Description
--- | ---
\BuildException | When the tool cannot be found

`init( ) : void`

Init method: requires the PEAR System class

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 |

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

The main entry point method.

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

Perfrom this task

Inherited from: \Task::perform()
`render( string $tool, string $source, string $targetFile ) : void`

Renders a single file and applies filters on it

Parameters

Name | Type | Description
--- | --- | ---
$tool | string | conversion tool to use
$source | string | rST source file
$targetFile | string | target file name

`renderFile( string $tool, string $source, string $targetFile ) : void`

Renders a single file with the rST tool.

Parameters

Name | Type | Description
--- | --- | ---
$tool | string | conversion tool to use
$source | string | rST source file
$targetFile | string | target file name

Throws

Exception | Description
--- | ---
\BuildException | When the conversion fails

`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

`setDestination( string $destination ) : void`

The setter for the attribute "destination"

Parameters

Name | Type | Description
--- | --- | ---
$destination | string | Output file or directory. When it ends with a slash, it is taken as directory.

`setFile( string $file ) : void`

The setter for the attribute "file"

Parameters

Name | Type | Description
--- | --- | ---
$file | string | Path of file to render

`setFormat( string $format ) : void`

The setter for the attribute "format"

Parameters

Name | Type | Description
--- | --- | ---
$format | string | Output format

Throws

Exception | Description
--- | ---
\BuildException | When the format is not supported

`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

`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

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

`setToolparam( string $param ) : void`

The setter for the attribute "toolparam"

Parameters

Name | Type | Description
--- | --- | ---
$param | string | Additional rst2* tool parameters

`setToolpath( $path ) : void`

The setter for the attribute "toolpath"

Parameters

Name | Type | Description
--- | --- | ---
$path |  |

Throws

Exception | Description
--- | ---
\BuildException | When the tool does not exist or is not executable

`setUptodate( string $uptodate ) : void`

The setter for the attribute "uptodate"

Parameters

Name | Type | Description
--- | --- | ---
$uptodate | string | True/false

Documentation was generated by DocBlox 0.15.1.