[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/vendor/phing/tasks/ext/ -> PearPackageTask.php (sommaire)

(pas de description)

Poids: 421 lignes (13 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 4 classes

PearPackageTask:: (13 méthodes):
  init()
  setOptions()
  fixDeps()
  populateOptions()
  main()
  getFileSets()
  createFileSet()
  setPackage()
  setDir()
  setName()
  setDestFile()
  createOption()
  createMapping()

PearPkgOption:: (5 méthodes):
  setName()
  getName()
  setValue()
  getValue()
  addText()

PearPkgMapping:: (5 méthodes):
  setName()
  getName()
  createElement()
  getElements()
  getValue()

PearPkgMappingElement:: (5 méthodes):
  setKey()
  getKey()
  setValue()
  getValue()
  createElement()


Classe: PearPackageTask  - X-Ref

A task to create PEAR package.xml file.

This class uses the PEAR_PackageFileMaintainer class to perform the work.

This class is designed to be very flexible -- i.e. account for changes to the package.xml w/o
requiring changes to this class.  We've accomplished this by having generic <option> and <mapping>
nested elements.  All options are set using PEAR_PackageFileMaintainer::setOptions().

The <option> tag is used to set a simple option value.
<code>
<option name="option_name" value="option_value"/>
or <option name="option_name">option_value</option>
</code>

The <mapping> tag represents a complex data type.  You can use nested <element> (and nested <element> with
<element> tags) to represent the full complexity of the structure.  Bear in mind that what you are creating
will be mapped to an associative array that will be passed in via PEAR_PackageFileMaintainer::setOptions().
<code>
<mapping name="option_name">
<element key="key_name" value="key_val"/>
<element key="key_name" value="key_val"/>
</mapping>
</code>

Here's an over-simple example of how this could be used:
<code>
<pearpkg name="phing" dir="${build.src.dir}" destFile="${build.base.dir}/package.xml">
<fileset>
<include name="**"/>
</fileset>
<option name="notes">Sample release notes here.</option>
<option name="description">Package description</option>
<option name="summary">Short description</option>
<option name="version" value="2.0.0b1"/>
<option name="state" value="beta"/>
<mapping name="maintainers">
<element>
<element key="handle" value="hlellelid"/>
<element key="name" value="Hans"/>
<element key="email" value="hans@xmpl.org"/>
<element key="role" value="lead"/>
</element>
</mapping>
</pearpkg>
</code>

Look at the build.xml in the Phing base directory (assuming you have the full distro / CVS version of Phing) to
see a more complete example of how to call this script.

init()   X-Ref
Pas de description

setOptions()   X-Ref
Sets PEAR package.xml options, based on class properties.

return: void

fixDeps($deps)   X-Ref
Fixes the boolean in optional dependencies


populateOptions()   X-Ref
Adds the options that are set via attributes and the nested tags to the options array.


main()   X-Ref
Main entry point.

return: void

getFileSets()   X-Ref
Used by the PEAR_PackageFileManager_PhingFileSet lister.

return: array FileSet[]

createFileSet()   X-Ref
Nested creator, creates a FileSet for this task

return: FileSet The created fileset object

setPackage($v)   X-Ref
Set "package" property from XML.

param: string $v
return: void

setDir(PhingFile $f)   X-Ref
Sets "dir" property from XML.

param: PhingFile $f
return: void

setName($v)   X-Ref
Sets "name" property from XML.

param: string $v
return: void

setDestFile(PhingFile $f)   X-Ref
Sets the file to use for generated package.xml


createOption()   X-Ref
Handles nested generic <option> elements.


createMapping()   X-Ref
Handles nested generic <option> elements.


Classe: PearPkgOption  - X-Ref

Generic option class is used for non-complex options.

setName($v)   X-Ref
Pas de description

getName()   X-Ref
Pas de description

setValue($v)   X-Ref
Pas de description

getValue()   X-Ref
Pas de description

addText($txt)   X-Ref
Pas de description

Classe: PearPkgMapping  - X-Ref

Handles complex options <mapping> elements which are hashes (assoc arrays).

setName($v)   X-Ref
Pas de description

getName()   X-Ref
Pas de description

createElement()   X-Ref
Pas de description

getElements()   X-Ref
Pas de description

getValue()   X-Ref
Returns the PHP hash or array of hashes (etc.) that this mapping represents.

return: array

Classe: PearPkgMappingElement  - X-Ref

Sub-element of <mapping>.

setKey($v)   X-Ref
Pas de description

getKey()   X-Ref
Pas de description

setValue($v)   X-Ref
Pas de description

getValue()   X-Ref
Returns either the simple value or
the calculated value (array) of nested elements.

return: mixed

createElement()   X-Ref
Handles nested <element> tags.




Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7