classes/phing/tasks/ext/CapsuleTask.php
\AssignedVar
An "inner" class for holding assigned var values.
May be need to expand beyond name/value in the future.
- package
- phing.tasks.ext
Properties
Methods
\CapsuleTask
A phing task for generating output by using Capsule.
This is based on the interface to TexenTask from Apache's Velocity engine.
- Extends from
- \Task
- author
- Hans Lellelid
- copyright
- 2001,2002 THYRELL. All rights reserved
- package
- phing.tasks.ext
- version
- $Id: CapsuleTask.php 843 2010-09-02 14:39:13Z mrook $
Properties

array
$assignedVars= 'array'
Any vars assigned via the build file.
AssignedVar[]arrayDetails- Type
- array

array
$contextProperties= ''
<p> These are properties that are fed into the initial context from a properties file. This is simply a convenient way to set some values that you wish to make available in the context.
These values are not critical, like the template path or output path, but allow a convenient way to set a value that may be specific to a particular generation task.
<
p>
For example, if you are generating scripts to allow
user to automatically create a database, then
you might want the $databaseName
to be placed
in the initial context so that it is available
in a script that might look something like the
following:
#!bin/sh echo y | mysqladmin create $databaseName
The value of $databaseName isn't critical to
output, and you obviously don't want to change
the ant task to simply take a database name.
So initial context values can be set with
properties file.
- Type
- array

string
$controlTemplate= ''
This is the control template that governs the output.
It may or may not invoke the services of worker templates.
- Type
- string

string
$outputDirectory= ''
This is where texen will place all the output that is a product of the generation process.
- Type
- string

string
$outputFile= ''
This is the file where the generated text will be placed.
- Type
- string
Methods

cleanup(
)
:
void- throws
- Problem cleaning up.

getContextProperties(
)
:
\Properties| Type | Description |
|---|---|
| \Properties |

getControlTemplate(
)
:
string| Type | Description |
|---|---|
| string |

getOutputFile(
)
:
string| Type | Description |
|---|---|
| string |

getTemplatePath(
)
:
string| Type | Description |
|---|---|
| string |

initControlContext(
)
:
\Smarty| Type | Description |
|---|---|
| \Smarty |
- throws
- the execute method will catch and rethrow as a
BuildException

main(
)
:
- throws
- BuildExceptions are thrown when required attributes are missing. Exceptions thrown by Velocity are rethrown as BuildExceptions.

populateInitialContext(
\Capsule $context
)
:
void| Name | Type | Description |
|---|---|---|
| $context | \Capsule | The context to populate, as retrieved from {@link #initControlContext()}. |
- throws
- Error while populating context. The {@link #main()} method will catch and rethrow as a
BuildException.

setContextProperties(
string $file
)
:
void| Name | Type | Description |
|---|---|---|
| $file | string |

setControlTemplate(
string $controlTemplate
)
:
void| Name | Type | Description |
|---|---|---|
| $controlTemplate | string |

setOutputDirectory(
\PhingFile $outputDirectory
)
:
void| Name | Type | Description |
|---|---|---|
| $outputDirectory | \PhingFile |
- throws

setOutputFile(
string $outputFile
)
:
void| Name | Type | Description |
|---|---|---|
| $outputFile | string | (TODO: change this to File) |