# tasks/ext/pearpackage/Fileset.php

Builds list of files for PEAR_PackageFileManager using a Phing FileSet.

Some code here is taken from PEAR_PackageFileManager_File -- getting results from flat array into the assoc array expected from getFileList().

Author
  Greg Beaver
Author
  Hans Lellelid
Package
  phing.tasks.ext.pearpackage
Version
  $Revision: 772 $

## \PEAR_PackageFileManager_Fileset
jump to top

Package: phing\tasks\ext\pearpackage

Builds list of files for PEAR_PackageFileManager using a Phing FileSet.

Some code here is taken from PEAR_PackageFileManager_File -- getting results from flat array into the assoc array expected from getFileList().

Author
  Greg Beaver
Author
  Hans Lellelid
Version
  $Revision: 772 $

### Properties

`array $filesets= 'array()'`

FileSets to use.

FileSet[]
Default value `array()`Details

Type
  array

`\Project $project= ''`

Curent Phing Project.

Details

Type
  \Project

### Methods

`__construct( $options ) : void`

Set up the FileSet filelist generator

'project' and 'filesets' are the only options that this class uses.

Parameters

Name | Type | Description
--- | --- | ---
$options |  | PEAR_PackageFileManager

`getFileList( ) : array`

Generate the section of the package file.

This function performs the backend generation of the array containing all files in this package

Returns

Type | Description
--- | ---
array | structure of all files to include

`mystrucsort( $a, $b ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$a |  |
$b |  |

`setDir( $dir, $contents ) : array`

Recursively add all the subdirectories of $contents to $dir without erasing anything in $dir

Parameters

Name | Type | Description
--- | --- | ---
$dir |  | array
$contents |  | array

Returns

Type | Description
--- | ---
array | processed $dir

`setupDirs( array $struc, array $dir, $contents ) : array`

Recursively move contents of $struc into associative array

The contents of $struc have many indexes like 'dir/subdir/subdir2'. This function converts them to array('dir' => array('subdir' => array('subdir2')))

Parameters

Name | Type | Description
--- | --- | ---
$struc | array | struc is array('dir' => array of files in dir, 'dir/subdir' => array of files in dir/subdir,...)
$dir | array | array form of 'dir/subdir/subdir2' array('dir','subdir','subdir2')
$contents |  |

Returns

Type | Description
--- | ---
array | same as struc but with array('dir' => array(file1,file2,'subdir' => array(file1,...)))

`sortfiles( $a, $b ) : void`

Sorting functions for the file list

Parameters

Name | Type | Description
--- | --- | ---
$a |  | string
$b |  | string

Details

Access
  private

Documentation was generated by DocBlox 0.17.1.