tasks/ext/PearPackageTask.php

Show: inherited
Table of Contents

\PearPackageTask

Package: phing\tasks\ext

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

The


The tag represents a complex data type. You can use nested (and nested with 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().


 
 

Here's an over-simple example of how this could be used:


 
  
 
 
 
 
 

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.

Parent(s)
\MatchingTask < \Task < \ProjectComponent
Children
\PearPackage2Task
Author
Hans Lellelid  
Version
$Id: PearPackageTask.php 1162 2011-06-17 21:24:01Z mrook $  

Properties

Propertyprotected  $dir= ''

Base directory for reading files.

Details
Type
n/a
Propertyprivatearray  $filesets= 'array()'

FileSet[]
Default valuearray()Details
Type
array
Propertyprotected  $mappings= 'array()'

Nested <mapping> (complex options) types.

Default valuearray()Details
Type
n/a
Propertyprotectedarray  $options= 'array()'

PearPkgOption[]
Default valuearray()Details
Type
array
Propertyprotected  $package= ''

Details
Type
n/a
Propertyprivate  $packageFile= ''

Package file

Details
Type
n/a
Propertyprotected\PEAR_PackageFileManager  $pkg= ''

Details
Type
\PEAR_PackageFileManager
Propertyprivate  $preparedOptions= 'array()'
Default valuearray()Details
Type
n/a
Propertyprotected\PearPkgRole[]  $roles= 'array()'

Nested <role> elements

Default valuearray()Details
Type
\PearPkgRole[]

Methods

methodpublic__construct( ) : void

methodpublicappendSelector( ) : void

methodpubliccreateAnd( ) : void

methodpubliccreateContains( ) : void

methodpubliccreateCustom( ) : void

methodpubliccreateDate( ) : void

methodpubliccreateDepend( ) : void

methodpubliccreateDepth( ) : void

methodpubliccreateExclude( ) : void

methodpubliccreateExcludesFile( ) : void

methodpubliccreateFileSet( ) : \FileSet

Nested creator, creates a FileSet for this task

Returns
Type Description
\FileSet The created fileset object
methodpubliccreateFilename( ) : void

methodpubliccreateInclude( ) : void

methodpubliccreateIncludesFile( ) : void

methodpubliccreateMajority( ) : void

methodpubliccreateMapping( ) : void

Handles nested generic

methodpubliccreateNone( ) : void

methodpubliccreateNot( ) : void

methodpubliccreateOption( ) : void

Handles nested generic

methodpubliccreateOr( ) : void

methodpubliccreatePatternSet( ) : void

methodpubliccreatePresent( ) : void

methodpubliccreateRole( ) : \PearPkgRole

Handles nested elements

Returns
Type Description
\PearPkgRole
methodpubliccreateSelector( ) : void

methodpubliccreateSize( ) : void

methodprivatefixDeps(  $deps ) : void

Fixes the boolean in optional dependencies

Parameters
Name Type Description
$deps
methodpublicgetDescription( ) : void

methodprotectedgetDirectoryScanner( ) : void

methodpublicgetFileSets( ) : array

Used by the PEAR_PackageFileManager_PhingFileSet lister.

Returns
Type Description
array FileSet[]
methodprotectedgetImplicitFileSet( ) : void
final

methodpublicgetLocation( ) : void

methodpublicgetOwningTarget( ) : void

methodpublicgetProject( ) : void

methodprotectedgetRegisterSlot( ) : void

methodpublicgetRuntimeConfigurableWrapper( ) : void

methodpublicgetSelectors( ) : void

methodpublicgetTaskName( ) : void

methodpublicgetTaskType( ) : void

methodpublichasSelectors( ) : void

methodpublicinit( ) : void

methodpubliclog( ) : void

methodpublicmain( ) : void

Main entry point.

methodpublicmaybeConfigure( ) : void

methodpublicperform( ) : void

methodprivatepopulateOptions( ) : void

Adds the options that are set via attributes and the nested tags to the options array.

methodpublicselectorCount( ) : void

methodpublicselectorElements( ) : void

methodpublicsetCaseSensitive( ) : void

methodpublicsetDefaultexcludes( ) : void

methodpublicsetDescription( ) : void

methodpublicsetDestFile(  $f ) : void

Sets the file to use for generated package.xml

Parameters
Name Type Description
$f
methodpublicsetDir( \PhingFile $f ) : void

Sets "dir" property from XML.

Parameters
Name Type Description
$f \PhingFile
methodpublicsetExcludes( ) : void

methodpublicsetExcludesfile( ) : void

methodpublicsetFollowSymlinks( ) : void

methodpublicsetIncludes( ) : void

methodpublicsetIncludesfile( ) : void

methodpublicsetLocation( ) : void

methodpublicsetName( string $v ) : void

Sets "name" property from XML.

Parameters
Name Type Description
$v string
methodprotectedsetOptions( ) : void

Sets PEAR package.xml options, based on class properties.

methodpublicsetOwningTarget( ) : void

methodpublicsetPackage( string $v ) : void

Set "package" property from XML.

Parameters
Name Type Description
$v string
Details
See
\setName()  
methodpublicsetProject( ) : void

methodpublicsetRuntimeConfigurableWrapper( ) : void

methodpublicsetTaskName( ) : void

methodpublicsetTaskType( ) : void

\PearPkgMapping

Package: phing\tasks\ext

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

Properties

Propertyprivate  $elements= 'array()'
Default valuearray()Details
Type
n/a
Propertyprivate  $name= ''
Details
Type
n/a

Methods

methodpubliccreateElement( ) : void

methodpublicgetElements( ) : void

methodpublicgetName( ) : void

methodpublicgetValue( ) : array

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

Returns
Type Description
array
methodpublicsetName(  $v ) : void

Parameters
Name Type Description
$v

\PearPkgMappingElement

Package: phing\tasks\ext

Sub-element of <mapping>.

Properties

Propertyprivate  $elements= 'array()'
Default valuearray()Details
Type
n/a
Propertyprivate  $key= ''
Details
Type
n/a
Propertyprivate  $value= ''
Details
Type
n/a

Methods

methodpubliccreateElement( ) : void

Handles nested tags.

methodpublicgetKey( ) : void

methodpublicgetValue( ) : mixed

Returns either the simple value or the calculated value (array) of nested elements.

Returns
Type Description
mixed
methodpublicsetKey(  $v ) : void

Parameters
Name Type Description
$v
methodpublicsetValue(  $v ) : void

Parameters
Name Type Description
$v

\PearPkgOption

Package: phing\tasks\ext

Generic option class is used for non-complex options.

Properties

Propertyprivate  $name= ''
Details
Type
n/a
Propertyprivate  $value= ''
Details
Type
n/a

Methods

methodpublicaddText(  $txt ) : void

Parameters
Name Type Description
$txt
methodpublicgetName( ) : void

methodpublicgetValue( ) : void

methodpublicsetName(  $v ) : void

Parameters
Name Type Description
$v
methodpublicsetValue(  $v ) : void

Parameters
Name Type Description
$v

\PearPkgRole

Package: phing\tasks\ext

Encapsulates file roles

Properties

Propertyprivatestring  $extension= ''

Details
Type
string
Propertyprivatestring  $role= ''

Details
Type
string

Methods

methodpublicgetExtension( ) : string

Retrieves the file extension

Returns
Type Description
string
methodpublicgetRole( ) : string

Retrieves the role

Returns
Type Description
string
methodpublicsetExtension( string $extension ) : void

Sets the file extension

Parameters
Name Type Description
$extension string
methodpublicsetRole( string $role ) : void

Sets the role

Parameters
Name Type Description
$role string
Documentation was generated by DocBlox 0.17.1.