CInbox (Common-Inbox)  0.1
Common functionality for ingesting files for archiving.
Public Member Functions | Public Attributes
TaskHashGenerate Class Reference
Inheritance diagram for TaskHashGenerate:
TaskHash CITask

List of all members.

Public Member Functions

 __construct (&$CIFolder)
 init ()
 run ()

Public Attributes

const TASK_LABEL = 'Generate Hashcodes'

Protected Member Functions

Task-specific methods
 generateHashcodes ($sourceFolder)
 generateHashcode ($fileName)
 checkForHashDuplicates ()

Detailed Description

Generates hashcodes for files in folder.

Author:
Peter Bubestinger-Steindl (pb@av-rd.com)
See also:

Member Function Documentation

Checks if each hashcode only appears exactly once. If files in source have identical hashcodes, this either means there are duplicates or danger of possible hashcode collision.

Returns array of duplicate hashcodes (if found). Returns false if all hashcodes are unique.

TaskHashGenerate::generateHashcode ( fileName) [protected]

Generates a hashcode for a file. The hashcode algorithm type is defined in '$this->hashType'.

TaskHashGenerate::generateHashcodes ( sourceFolder) [protected]

Generates hashcodes for all files in $sourceFolder and saves them to temp-files.

For each file, it checks if the temp-file can be written, before calculating the actual hashcode. This avoids unnecessary hashcode calculation in case that the result could not be written anyway.

Prepare everything so it's ready for processing.

Returns:
bool success True if init went fine, False if an error occurred.

Reimplemented from CITask.

Perform the actual steps of this task.

Reimplemented from CITask.


The documentation for this class was generated from the following file:
 All Classes Functions Variables