# classes/phing/tasks/ext/ManifestTask.php

## \ManifestTask
jump to top

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:

Extends from
  \Task
author
  David Persson
copyright
  2001,2002 THYRELL. All rights reserved
package
  phing.tasks.ext
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

`array $filesets= 'array'`

Holds filesets

An Array of objects
Default value `array` Details

Type
  array

`array $meta= 'array'`

Holds some data collected during runtime

Default value `array` Details

Type
  array

`string $salt= ''`

A string used in hashing method

Details

Type
  string

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

Type

### Methods

`createFileSet( ) : object`
Nested creator, creates a FileSet for this task
Returns

Type | Description
--- | ---
object |

Details

access
  public

`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 |

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 |

`init( ) :`
The init method: Do init steps.
`main( ) :`
Delegate the work
`read( ) :`
Details

todo
  implement

`setChecksum( mixed $mixed ) : void`
The setter for the attribute "checksum"
Parameters

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

`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

`setSalt( string $string ) : void`
The setter for the optional attribute "salt"
Parameters

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

`validateAttributes( ) : void`
Validates attributes coming in from XML
Details

access
  private
throws

`write( ) :`
Creates Manifest file Writes to $this->file
Details

throws

Documentation was generated by DocBlox 0.13.1.