|
CInbox (Common-Inbox)
0.1
Common functionality for ingesting files for archiving.
|
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 () | |
Generates hashcodes for files in folder.
| TaskHashGenerate::checkForHashDuplicates | ( | ) | [protected] |
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.
Reimplemented from CITask.
Perform the actual steps of this task.
Reimplemented from CITask.
1.7.6.1