classes/phing/tasks/ext/XmlPropertyTask.php

Task for setting properties from an XML file in buildfiles.

author
Jonathan Bond-Caron
link
http://ant.apache.org/manual/CoreTasks/xmlproperty.html
package
phing.tasks.ext
since
2.4.0
version
$Revision: 1110 $

\XmlPropertyTask

Task for setting properties from an XML file in buildfiles.

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

Extends from
\PropertyTask
author
Jonathan Bond-Caron
copyright
2001,2002 THYRELL. All rights reserved
link
http://ant.apache.org/manual/CoreTasks/xmlproperty.html
package
phing.tasks.ext
since
2.4.0
version
$Revision: 1110 $

Properties

Propertyprivate  $_collapseAttr= 'false'
Default valuefalseDetails
Type
Propertyprivate  $_delimiter= ','
Default value,Details
Type
Propertyprivate  $_keepRoot= 'true'
Default valuetrueDetails
Type

Methods

methodprotected  _addNode( \SimpleXMLElement $node, array $path, \Properties $prop ) : void
Adds an XML node
Parameters
Name Type Description
$node \SimpleXMLElement
$path array Path to this node
$prop \Properties

Properties will be added as they are found (by reference here)

methodprotected  _getProperties( string $filePath ) : \Properties
Parses an XML file and returns properties
Parameters
Name Type Description
$filePath string
Returns
Type Description
\Properties
methodpublic  getCollapseAttributes( ) : bool
Returns
Type Description
bool
methodpublic  getDelimiter( ) : string
Returns
Type Description
string
methodpublic  getFile( ) :
Get the PhingFile that is being used as property source.
methodpublic  getKeepRoot( ) : bool
Returns
Type Description
bool
methodpublic  getPrefix( ) : string
Returns
Type Description
string
Details
since
2.0
methodprotected  loadFile( \PhingFile $file ) :
load properties from an XML file.
Parameters
Name Type Description
$file \PhingFile
methodpublic  main( ) :
set the property in the project to the value.

if the task was give a file or env attribute here is where it is loaded

methodpublic  setCollapseAttributes( bool $yesNo ) :
Treat attributes as nested elements.
Parameters
Name Type Description
$yesNo bool
methodpublic  setDelimiter( string $d ) :
Delimiter for splitting multiple values.
Parameters
Name Type Description
$d string
methodpublic  setFile(  $file ) :
Set a file to use as the source for properties.
Parameters
Name Type Description
$file
methodpublic  setKeepRoot( bool $yesNo ) :
Keep the xml root tag as the first value in the property name
Parameters
Name Type Description
$yesNo bool
methodpublic  setPrefix( string $prefix ) : void
Prefix to apply to properties loaded using file.

A "." is appended to the prefix if not specified.

Parameters
Name Type Description
$prefix string prefix string
Details
since
2.0
Documentation was generated by DocBlox 0.13.1.