# tasks/ext/FileHashTask.php

fileHash

Calculate either MD5 or SHA hash value of a specified file and retun the value in a property

Author
  Johan Persson
Package
  phing.tasks.ext
Version
  $Id: FileHashTask.php 1084 2011-05-06 09:55:25Z mrook $

## \FileHashTask
jump to top

Package: phing\tasks\ext

fileHash

Calculate either MD5 or SHA hash value of a specified file and retun the value in a property

Parent(s)
  \Task < \ProjectComponent
Author
  Johan Persson
Version
  $Id: FileHashTask.php 1084 2011-05-06 09:55:25Z mrook $

### Properties

`\PhingFile $file= ''`

Property for File

file
Details

Type
  \PhingFile

`integer $hashtype= '0'`

Specify which hash algorithm to use.

0 = MD5 1 = SHA1

Default value `0` Details

Type
  integer

`string $propertyName= '"filehashvalue"'`

Property to be set

Default value`"filehashvalue"`Details

Type
  string

### Methods

`checkFile( ) : void`

checks file attribute

Throws

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

`checkPropertyName( ) : void`

checks property attribute

Throws

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

`getDescription( ) : void`

`getLocation( ) : void`

`getOwningTarget( ) : void`

`getProject( ) : void`

`getRegisterSlot( ) : void`

`getRuntimeConfigurableWrapper( ) : void`

`getTaskName( ) : void`

`getTaskType( ) : void`

`init( ) : void`

`log( ) : void`

`main( ) : void`

Main-Method for the Task

Throws

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

`maybeConfigure( ) : void`

`perform( ) : void`

`setDescription( ) : void`

`setFile( \PhingFile $file ) : void`

Which file to calculate the hash value of

Parameters

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

`setHashtype( integer $type ) : void`

Specify if MD5 or SHA1 hash should be used

Parameters

Name | Type | Description
--- | --- | ---
$type | integer | 0=MD5, 1=SHA1

`setLocation( ) : void`

`setOwningTarget( ) : void`

`setProject( ) : void`

`setPropertyName( $property ) : void`

Set the name of the property to store the hash value in

Parameters

Name | Type | Description
--- | --- | ---
$property |  |

`setRuntimeConfigurableWrapper( ) : void`

`setTaskName( ) : void`

`setTaskType( ) : void`

Documentation was generated by DocBlox 0.17.1.