Displays all the current properties in the build. The output can be sent to a file if desired.
Attribute "destfile" defines a file to send the properties to. This can be processed as a standard property file later.
Attribute "prefix" defines a prefix which is used to filter the properties only those properties starting with this prefix will be echoed.
By default, the "failonerror" attribute is enabled. If an error occurs while writing the properties to a file, and this attribute is enabled, then a BuildException will be thrown. If disabled, then IO errors will be reported as a log statement, but no error will be thrown.
Examples:
<echoproperties />Report the current properties to the log.
<echoproperties destfile="my.properties" />Report the current properties to the file "my.properties", and will fail the build if the file could not be created or written to.
<echoproperties destfile="my.properties" failonerror="false" prefix="phing" />Report all properties beginning with 'phing' to the file "my.properties", and will log a message if the file could not be created or written to, but will still allow the build to continue.
author |
Siad Ardroumli siad.ardroumli@gmail.com |
---|---|
package |
phing.tasks.system |
failOnErrorAction(\Exception $exception = null, string $message = '', integer $level = \Project::MSG_INFO)
throws | |
---|---|
\Exception
string
integer
getDescription() : string
string
The text description of the task
getLocation() : \Location
getOwningTarget() : \Target
getProject() : \Project
getRegisterSlot(string $slotName) : \RegisterSlot
getRuntimeConfigurableWrapper() : \RuntimeConfigurable
getTaskName() : string
string
Name of this task
getTaskType() : string
string
The type of this task (XML Tag)
init()
Should throw a BuildException if something goes wrong with the build
This is abstract here, but may not be overloaded by subclasses.
throws | |
---|---|
log(string $msg, integer $level = \Project::MSG_INFO) : void
string
The message to be logged.
integer
The message's priority at this message should have
main()
Should throw a BuildException if someting goes wrong with the build
This is abstract here. Must be overloaded by real tasks.
maybeConfigure()
perform()
throws | |
---|---|
saveProperties(array $allProps, \OutputStream $os)
Only those properties matching the prefix constraint will be sent to the output stream. The output stream will be closed when this method returns.
throws |
on output errors on other errors |
---|---|
array
propfile to save
setDescription(string $desc)
string
The text describing the task
setDestfile(string|\PhingFile $destfile)
setFailOnError( $failonerror)
setFormat(string $ea)
string
an enumerated FormatAttribute
value
setLocation(\Location $location)
setOwningTarget(\Target $target)
setPrefix(string $prefix)
For example, if the attribute is set as:
<echoproperties prefix="phing." />
then the property "phing.home" will be recorded, but "phing-example" will not.
string
The new prefix value
setProject(\Project $project) : void
setRegex(string $regex)
For example, if the attribute is set as:
<echoproperties prefix=".*phing.*" />
then the properties "phing.home" and "user.phing" will be recorded, but "phing-example" will not.
string
The new regex value
setRuntimeConfigurableWrapper(\RuntimeConfigurable $wrapper)
setSrcfile(string|\PhingFile $file)
setTaskName(string $name) : string
string
string
A string representing the name of this task for log
setTaskType( $name)
textSaveProperties(\Properties $props, \OutputStream $os, string $header)
throws |
on an I/O error during a write. |
---|---|
string
prepend this header to the property output
xmlSaveProperties(\Properties $props, \OutputStream $os)
throws | |
---|---|
PROPERTIES :
PROPERTY :
ATTR_NAME :
ATTR_VALUE :
destfile : \PhingFile
failonerror : boolean
var |
---|
boolean
format : string
var |
---|
string
prefix : string
var |
---|
string
regex : string
var |
---|
string
description : string
var |
---|
string
taskType : string
var |
---|
string
taskName : string
var |
---|
string
project : \Project