|
CInbox (Common-Inbox)
0.1
Common functionality for ingesting files for archiving.
|
Public Member Functions | |
| __construct (&$CIFolder) | |
| loadHashFromFile ($fileName) | |
| getTempHashForFilename ($fileName) | |
| getHashTypesAllowed () | |
Static Public Member Functions | |
| static | getHashTempFilename ($fileName, $CIFolder, $hashType) |
Public Attributes | |
| const | TASK_LABEL = 'Hash Base (abstract)' |
| const | CONF_HASH_TYPE = 'HASH_TYPE' |
Protected Member Functions | |
| loadSettings () | |
| saveHashToFile ($fileName, $hashCode) | |
| getTempHashForFolder ($folderName) | |
| hashTypeIsAllowed ($hashType) | |
| generateHashcode ($hashType, $fileName) | |
| compareHashcode ($hash1, $hash2) | |
Protected Attributes | |
| $hashType | |
Abstract base class for hashcode-related tasks. Provides common methods useful for handling hashcodes as well as read/writing their temp files.
| TaskHash::compareHashcode | ( | $ | hash1, |
| $ | hash2 | ||
| ) | [protected] |
Checks if $hash1 matches $hash2. Comparison is case insensitive.
| TaskHash::generateHashcode | ( | $ | hashType, |
| $ | fileName | ||
| ) | [protected] |
Generates a hashcode for a file.
| static TaskHash::getHashTempFilename | ( | $ | fileName, |
| $ | CIFolder, | ||
| $ | hashType | ||
| ) | [static] |
Returns the filename where hashcodes are temporarily stored for $fileName. This method is static, so it can be used by other tasks to determine where to find the temporary hashcode files.
Returns an array containing the hash algorithm types allowed/supported.
| TaskHash::getTempHashForFilename | ( | $ | fileName | ) |
Returns the hashcode from pre-calculated temp hashfiles. Requires TaskHashGenerate to be run before.
| TaskHash::getTempHashForFolder | ( | $ | folderName | ) | [protected] |
Returns an array with hashcodes of all files in the given folder. Hashcodes are read from temp-hashfiles. Array structure is: key: filename (absolute) value: hashcode
| TaskHash::hashTypeIsAllowed | ( | $ | hashType | ) | [protected] |
Checks if provided hashtype is supported by this task. By default, all hash algorithms supported by PHP are allowed.
| TaskHash::loadHashFromFile | ( | $ | fileName | ) |
Reads the hashcode from a file. The format of the file must match the format that "saveHashToFile" writes. Returns the hashcode in lowercase.
| TaskHash::loadSettings | ( | ) | [protected] |
Load settings from config that are relevant for this task.
Reimplemented from CITask.
Reimplemented in TaskHashOutput, and TaskHashSearch.
| TaskHash::saveHashToFile | ( | $ | fileName, |
| $ | hashCode | ||
| ) | [protected] |
Writes the hascode to a file.
Hashcode is forced to lowercase. Default format: Plain text. Just the hashcode and a newline (
) character. Nothing else.
1.7.6.1