# tasks/ext/ManifestTask.php

$Id: ManifestTask.php 552 2009-08-29 12:18:13Z mrook $

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software consists of voluntary contributions made by many individuals and is licensed under the LGPL. For more information please see http://phing.info.

## \ManifestTask
jump to top

Package: phing\tasks\ext

ManifestTask

Generates a simple Manifest file with optional checksums.

Manifest schema: ... path/to/file CHECKSUM [CHECKSUM2] [CHECKSUM3] path/to/secondfile CHECKSUM [CHECKSUM2] [CHECKSUM3] ...

Example usage:

Parent(s)
  \Task < \ProjectComponent
Author
  David Persson
Since
  2.3.1
Version
  $Id: ManifestTask.php 552 2009-08-29 12:18:13Z mrook $

### Properties

`string $action= ''w''`

Action

"r" or "w"

"w" for reading in files from fileSet and writing manifest

or

"r" for reading in files from fileSet and checking against manifest

Default value`'w'`Details

Type
  string

`mixed $checksum= 'false'`

Enable/Disable checksuming or/and select algorithm true defaults to md5 false disables checksuming string "md5,sha256,..." enables generation of multiple checksums string "sha256" generates sha256 checksum only

Default value `false` Details

Type
  mixed

`$destFile= 'null'`

The target file passed in the buildfile.

Default value `null` Details

Type
  n/a

`array $filesets= 'array()'`

Holds filesets

An Array of objects
Default value `array()`Details

Type
  array

`array $meta= 'array('totalFileCount' => 0'`

Holds some data collected during runtime

Default value `array('totalFileCount' => 0` Details

Type
  array

`string $salt= ''''`

A string used in hashing method

Default value`''`Details

Type
  string

`$taskname= ''manifest''`
Default value`'manifest'`Details

Type
  n/a

### Methods

`createFileSet( ) : object`

Nested creator, creates a FileSet for this task

Returns

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

Details

Access
  public

`getDescription( ) : void`

`getLocation( ) : void`

`getOwningTarget( ) : void`

`getProject( ) : void`

`getRegisterSlot( ) : void`

`getRuntimeConfigurableWrapper( ) : void`

`getTaskName( ) : void`

`getTaskType( ) : void`

`hash( string $msg, string $algo ) : mixed`

Wrapper method for hash generation Automatically selects extension Falls back to built-in functions

Parameters

Name | Type | Description
--- | --- | ---
$msg | string | The string that should be hashed
$algo | string | Algorithm

Returns

Type | Description
--- | ---
mixed | String on success, false if $algo is not available

Details

Link
  http://www.php.net/mhash
Link
  http://www.php.net/hash

`hashFile( string $file, string $algo ) : mixed`

Hash a files contents plus it's size an modification time

Parameters

Name | Type | Description
--- | --- | ---
$file | string |
$algo | string |

Returns

Type | Description
--- | ---
mixed | String on success, false if $algo is not available

`init( ) : void`

The init method: Do init steps.

`log( ) : void`

`main( ) : void`

Delegate the work

`maybeConfigure( ) : void`

`perform( ) : void`

`read( ) : void`

Details

Todo
  implement

`setChecksum( mixed $mixed ) : void`

The setter for the attribute "checksum"

Parameters

Name | Type | Description
--- | --- | ---
$mixed | mixed |

`setDescription( ) : void`

`setFile( string $file ) : void`

The setter for the attribute "file" This is where the manifest will be written to/read from

Parameters

Name | Type | Description
--- | --- | ---
$file | string | Path to readable file

`setLocation( ) : void`

`setOwningTarget( ) : void`

`setProject( ) : void`

`setRuntimeConfigurableWrapper( ) : void`

`setSalt( string $string ) : void`

The setter for the optional attribute "salt"

Parameters

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

`setTaskName( ) : void`

`setTaskType( ) : void`

`validateAttributes( ) : void`

Validates attributes coming in from XML

Throws

Exception | Description
--- | ---
\BuildException |

Details

Access
  private

`write( ) : void`

Creates Manifest file Writes to $this->file

Throws

Exception | Description
--- | ---
\BuildException |

Documentation was generated by DocBlox 0.17.1.