|
|
const | TASK_LABEL = 'Hash Base (abstract)' |
| |
|
const | CONF_HASH_TYPE = 'HASH_TYPE' |
| |
|
const | STATUS_UNDEFINED = 0 |
| | Undefined. Default unless task changes it.
|
| |
|
const | STATUS_RUNNING = 1 |
| | Undefined, but indicates that the task is in progress.
|
| |
|
const | STATUS_WAIT = 2 |
| | Task decided that Item is not ready yet and shall be moved back to 'to-do'.
|
| |
|
const | STATUS_DONE = 5 |
| | Success! This means the task completed successfully.
|
| |
|
const | STATUS_PBCT = 6 |
| | There were problems, but the task may continue.
|
| |
|
const | STATUS_PBC = 7 |
| | There were problems, but subsequent task may continue.
|
| |
|
const | STATUS_ERROR = 10 |
| | An error occurred. Abort execution as soon as possible.
|
| |
|
const | STATUS_CONFIG_ERROR = 11 |
| | If a config option was not valid.
|
| |
|
const | STATUS_SKIPPED = 15 |
| | If task was skipped.
|
| |
|
const | ONCE_PER_ITEM = false |
| | True: Run this task only once per item.
|
| |
|
const | IS_RECURSIVE = false |
| | Default (false): one task = one folder. True: The task performs actions on subfolders too.
|
| |
|
const | CONF_COPY_EXCLUDE = 'COPY_EXCLUDE' |
| | Patterns which files to exclude from copying.
|
| |
|
const | MASK_TARGET_TEMP = 'temp_%s' |
| |
|
|
| $hashType |
| |
|
| $logger |
| | Logging handler.
|
| |
|
| $name |
| | Class name of this task.
|
| |
|
| $label |
| | Human readable Task label.
|
| |
|
| $description |
| | Human readable description of Task's purpose/actions.
|
| |
|
| $CIFolder |
| | CIFolder object that provides all information needed for this task.
|
| |
|
| $sourceFolder |
| | Source folder of this task.
|
| |
|
| $targetFolder |
| | Target folder of this task (read from config).
|
| |
|
| $targetFolderTemp |
| | Temporary name of Target folder of this task. Used until inbox processing completed successfully.
|
| |
|
| $itemSubDirs |
| | Array of Item subfolders: key=foldername, value=CIFolder (initialized with its config).
|
| |
|
| $tempFolder |
| | Path of the temp folder for this task.
|
| |
|
| $copyExclude |
| | Contains the value of CONF_COPY_EXCLUDE.
|
| |
|
| $skip = false |
| | True: Skip execution. Default=false (=normal execution).
|
| |
|
| $status |
| | Status of this task (=for current item subfolder).
|
| |
|
|
static | $statusGlobal |
| | Status of the sum of tasks of this type. // TODO! Implement and use this.
|
| |
Abstract base class for hashcode-related tasks. Provides common methods useful for handling hashcodes as well as read/writing their temp files.
- Author
- Peter Bubestinger-Steindl (pb@av.nosp@m.-rd..nosp@m.com)
- Copyright
- Copyright 2018 AV-RD e.U. (License: GNU General Public License (v3))
- See also
-
| 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 the hashcode is 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.
| TaskHash::getHashTypesAllowed |
( |
| ) |
|
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.
| static TaskHash::removeHashTempFile |
( |
|
$fileName, |
|
|
|
$CIFolder, |
|
|
|
$hashType |
|
) |
| |
|
static |
Deletes the file where the hashcode is temporarily stored for $fileName. This method is static, so it can be used by other tasks to remove the temporary hashcode files.
| 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.
The documentation for this class was generated from the following file:
- /media/storage_1tb/storage/F_Drive/JobsToDo/Das-Firma/owncloud/Development/src-repositories/avrd.git/projects/cinbox/bin/tasks/TaskHash.php