|
CInbox (Common-Inbox)
0.1
Common functionality for ingesting files for archiving.
|
Public Member Functions | |
| __construct (&$CIFolder) | |
| init () | |
| run () | |
Public Attributes | |
| const | TASK_LABEL = 'Hashcode search' |
| const | CONF_HASH_SEARCH = 'HASH_SEARCH' |
| const | CONF_HASH_MUST_EXIST = 'HASH_MUST_EXIST' |
Protected Member Functions | |
| loadSettings () | |
| searchHashCodes ($sourceFolder) | |
| searchHashCode ($sourceFolder, $hashCode) | |
| findHashInFile ($fileName, $hashCode) | |
| checkMustExist ($filesMatched) | |
Protected Attributes | |
| $hashSearch | |
| $hashMustExist | |
For files matching 'HASH_MUST_EXIST', this task searches for existing hashes in files matching 'HASH_SEARCH' in the source folder in order to compare the current hashcode against it.
This allows to validate already existing hashes to document the chain of file transfer. It must be run *after* TaskHashGenerate, because the hashcodes are read from the temp-files created in that task.
| TaskHashSearch::checkMustExist | ( | $ | filesMatched | ) | [protected] |
Checks if all files in "$filesMatched" have a matching hashcode.
| TaskHashSearch::findHashInFile | ( | $ | fileName, |
| $ | hashCode | ||
| ) | [protected] |
Searches the given hashcode in a file. Returns the matching lines if found
Prepare everything so it's ready for processing.
Reimplemented from CITask.
| TaskHashSearch::loadSettings | ( | ) | [protected] |
Load settings from config that are relevant for this task.
Reimplemented from TaskHash.
Perform the actual steps of this task.
Reimplemented from CITask.
| TaskHashSearch::searchHashCode | ( | $ | sourceFolder, |
| $ | hashCode | ||
| ) | [protected] |
Tries to find the given hashcode in the source folder matching the glob patterns in "$this->hashSearch glob". Returns an array with key is filename where match was found - and value is an array of lines containing the hashcode. Returns false if no match is found.
| TaskHashSearch::searchHashCodes | ( | $ | sourceFolder | ) | [protected] |
Iterates through all files in source folder and searches for existing checksums.
1.7.6.1