# tasks/ext/PearPackageTask.php

## \PearPackageTask
jump to top

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 and nested elements. All options are set using PEAR_PackageFileMaintainer::setOptions().

The tag is used to set a simple option value.

    or option_value

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:

     Sample release notes here.
     Package description
     Short description

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

`$dir= ''`

Base directory for reading files.

Details

Type
  n/a

`array $filesets= 'array()'`

FileSet[]
Default value `array()`Details

Type
  array

`$mappings= 'array()'`

Nested <mapping> (complex options) types.

Default value `array()`Details

Type
  n/a

`array $options= 'array()'`

PearPkgOption[]
Default value `array()`Details

Type
  array

`$package= ''`

Details

Type
  n/a

`$packageFile= ''`

Package file

Details

Type
  n/a

`\PEAR_PackageFileManager $pkg= ''`

Details

Type
  \PEAR_PackageFileManager

`$preparedOptions= 'array()'`
Default value `array()`Details

Type
  n/a

`\PearPkgRole[] $roles= 'array()'`

Nested <role> elements

Default value `array()`Details

Type
  \PearPkgRole[]

### Methods

`__construct( ) : void`

`appendSelector( ) : void`

`createAnd( ) : void`

`createContains( ) : void`

`createCustom( ) : void`

`createDate( ) : void`

`createDepend( ) : void`

`createDepth( ) : void`

`createExclude( ) : void`

`createExcludesFile( ) : void`

`createFileSet( ) : \FileSet`

Nested creator, creates a FileSet for this task

Returns

Type | Description
--- | ---
\FileSet | The created fileset object

`createFilename( ) : void`

`createInclude( ) : void`

`createIncludesFile( ) : void`

`createMajority( ) : void`

`createMapping( ) : void`

Handles nested generic elements.

`createNone( ) : void`

`createNot( ) : void`

`createOption( ) : void`

Handles nested generic elements.

`createOr( ) : void`

`createPatternSet( ) : void`

`createPresent( ) : void`

`createRole( ) : \PearPkgRole`

Handles nested elements

Returns

Type | Description
--- | ---
\PearPkgRole |

`createSelector( ) : void`

`createSize( ) : void`

`fixDeps( $deps ) : void`

Fixes the boolean in optional dependencies

Parameters

Name | Type | Description
--- | --- | ---
$deps |  |

`getDescription( ) : void`

`getDirectoryScanner( ) : void`

`getFileSets( ) : array`

Used by the PEAR_PackageFileManager_PhingFileSet lister.

Returns

Type | Description
--- | ---
array | FileSet[]

`getImplicitFileSet( ) : void`
final

`getLocation( ) : void`

`getOwningTarget( ) : void`

`getProject( ) : void`

`getRegisterSlot( ) : void`

`getRuntimeConfigurableWrapper( ) : void`

`getSelectors( ) : void`

`getTaskName( ) : void`

`getTaskType( ) : void`

`hasSelectors( ) : void`

`init( ) : void`

`log( ) : void`

`main( ) : void`

Main entry point.

`maybeConfigure( ) : void`

`perform( ) : void`

`populateOptions( ) : void`

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

`selectorCount( ) : void`

`selectorElements( ) : void`

`setCaseSensitive( ) : void`

`setDefaultexcludes( ) : void`

`setDescription( ) : void`

`setDestFile( $f ) : void`

Sets the file to use for generated package.xml

Parameters

Name | Type | Description
--- | --- | ---
$f |  |

`setDir( \PhingFile $f ) : void`

Sets "dir" property from XML.

Parameters

Name | Type | Description
--- | --- | ---
$f | \PhingFile |

`setExcludes( ) : void`

`setExcludesfile( ) : void`

`setFollowSymlinks( ) : void`

`setIncludes( ) : void`

`setIncludesfile( ) : void`

`setLocation( ) : void`

`setName( string $v ) : void`

Sets "name" property from XML.

Parameters

Name | Type | Description
--- | --- | ---
$v | string |

`setOptions( ) : void`

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

`setOwningTarget( ) : void`

`setPackage( string $v ) : void`

Set "package" property from XML.

Parameters

Name | Type | Description
--- | --- | ---
$v | string |

Details

See
  \setName()

`setProject( ) : void`

`setRuntimeConfigurableWrapper( ) : void`

`setTaskName( ) : void`

`setTaskType( ) : void`

## \PearPkgMapping
jump to top

Package: phing\tasks\ext

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

### Properties

`$elements= 'array()'`
Default value `array()`Details

Type
  n/a

`$name= ''`
Details

Type
  n/a

### Methods

`createElement( ) : void`

`getElements( ) : void`

`getName( ) : void`

`getValue( ) : array`

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

Returns

Type | Description
--- | ---
array |

`setName( $v ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$v |  |

## \PearPkgMappingElement
jump to top

Package: phing\tasks\ext

Sub-element of <mapping>.

### Properties

`$elements= 'array()'`
Default value `array()`Details

Type
  n/a

`$key= ''`
Details

Type
  n/a

`$value= ''`
Details

Type
  n/a

### Methods

`createElement( ) : void`

Handles nested tags.

`getKey( ) : void`

`getValue( ) : mixed`

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

Returns

Type | Description
--- | ---
mixed |

`setKey( $v ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$v |  |

`setValue( $v ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$v |  |

## \PearPkgOption
jump to top

Package: phing\tasks\ext

Generic option class is used for non-complex options.

### Properties

`$name= ''`
Details

Type
  n/a

`$value= ''`
Details

Type
  n/a

### Methods

`addText( $txt ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$txt |  |

`getName( ) : void`

`getValue( ) : void`

`setName( $v ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$v |  |

`setValue( $v ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$v |  |

## \PearPkgRole
jump to top

Package: phing\tasks\ext

Encapsulates file roles

### Properties

`string $extension= ''`

Details

Type
  string

`string $role= ''`

Details

Type
  string

### Methods

`getExtension( ) : string`

Retrieves the file extension

Returns

Type | Description
--- | ---
string |

`getRole( ) : string`

Retrieves the role

Returns

Type | Description
--- | ---
string |

`setExtension( string $extension ) : void`

Sets the file extension

Parameters

Name | Type | Description
--- | --- | ---
$extension | string |

`setRole( string $role ) : void`

Sets the role

Parameters

Name | Type | Description
--- | --- | ---
$role | string |

Documentation was generated by DocBlox 0.17.1.