|
|
const | TASK_LABEL = 'Write hash output' |
| |
|
const | CONF_HASH_OUTPUT = 'HASH_OUTPUT' |
| |
|
const | CONF_HASH_FILENAME = 'HASH_FILENAME' |
| |
|
const | CONF_HASH_FILEFORMAT = 'HASH_FILEFORMAT' |
| |
|
const | OPT_OUTPUT_FILE = 'file' |
| |
|
const | OPT_OUTPUT_FOLDER = 'folder' |
| |
|
const | OPT_HASH_FORMAT_GNU = 'gnu' |
| |
|
const | OPT_HASH_FORMAT_WIN = 'win' |
| |
|
const | OPT_HASH_FORMAT_MACOS = 'macos' |
| |
|
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' |
| |
|
| static | $OPT_HASH_OUTPUTS |
| |
| static | $OPT_HASH_FILEFORMATS |
| |
|
| | loadSettings () |
| |
| | isValidHashOutput ($option) |
| |
| | isValidHashFileformat ($option) |
| |
| | formatHash ($outputMask, $hashType, $hashCode, $filename) |
| |
| | writeHashCodeFiles ($hashCodes, $targetFolder) |
| |
| | saveHashesToFile ($file, $contents, $overwrite=false) |
| |
| | appendHashcodes ($targetHashFile, $new) |
| |
| | loadSettings () |
| |
| | saveHashToFile ($fileName, $hashCode) |
| |
| | getTempHashForFolder ($folderName) |
| |
| | hashTypeIsAllowed ($hashType) |
| |
| | generateHashcode ($hashType, $fileName) |
| |
| | compareHashcode ($hash1, $hash2) |
| |
| | setName ($name) |
| |
| | exclude ($file, $excludePatterns) |
| |
| | optionIsArray ($option, $optionName) |
| |
| | resolveTargetFolderTemp ($CIFolder=null) |
| |
| | setStatus ($status) |
| |
| | setStatusUndefined () |
| |
| | setStatusRunning () |
| |
| | setStatusWait () |
| |
| | setStatusDone () |
| |
| | setStatusPBCT () |
| |
| | setStatusPBC () |
| |
| | setStatusSkipped () |
| |
| | setStatusError () |
| |
| | setStatusConfigError () |
| |
| | checkTempFolder () |
| |
| | getTempFolder () |
| |
| | setTempFolder ($tempFolder=null) |
| |
| | loadSettings () |
| |
|
|
| $hashOutput |
| |
|
| $hashFilename |
| |
|
| $hashFileformat |
| |
|
| $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).
|
| |
Writes the generated source-hashes to target. Format and location can be set in config file.
- 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
-
| TaskHashOutput::appendHashcodes |
( |
|
$targetHashFile, |
|
|
|
$new |
|
) |
| |
|
protected |
Appends new hashcode lines to contents of an existing hashcode file.
The format of the hashcode file should be identical, otherwise the resulting file will be corrupt. Duplicate entries are removed (Works only if format is identical).
Returns the result as array of text-lines.
| TaskHashOutput::formatHash |
( |
|
$outputMask, |
|
|
|
$hashType, |
|
|
|
$hashCode, |
|
|
|
$filename |
|
) |
| |
|
protected |
Returns one line for a hashcode output format, according to the format defined by $hashFormat.
Prepare everything so it's ready for processing.
- Returns
- bool success True if init went fine, False if an error occurred.
| TaskHashOutput::isValidHashFileformat |
( |
|
$option | ) |
|
|
protected |
Checks if the given mode is a valid option for CONF_HASH_FILEFORMAT. Returns 'true' if it is valid - 'false' if not.
The check is case-sensitive, so you might want to normalize case before calling this.
| TaskHashOutput::isValidHashOutput |
( |
|
$option | ) |
|
|
protected |
Checks if the given mode is a valid option for CONF_HASH_OUTPUT. Returns 'true' if it is valid - 'false' if not.
The check is case-sensitive, so you might want to normalize case before calling this.
| TaskHashOutput::loadSettings |
( |
| ) |
|
|
protected |
Load settings from config that are relevant for this task.
Perform the actual steps of this task.
| TaskHashOutput::saveHashesToFile |
( |
|
$file, |
|
|
|
$contents, |
|
|
|
$overwrite = false |
|
) |
| |
|
protected |
Writes formatted hashcode lines to file. If file exists and $overwrite is false, then hashcode lines will be appended.
appendHashcodes
| TaskHashOutput::writeHashCodeFiles |
( |
|
$hashCodes, |
|
|
|
$targetFolder |
|
) |
| |
|
protected |
Iterates through array $hashCodes and assembles each line for the output hash textfile, according to self::$OPT_HASH_FILEFORMATS.
Depending on the CONF_HASH_OUTPUT mode, the lines are written to the corresponding files on the target.
Existing hashcode files with the same name as defined by CONF_HASH_FILENAME will a) be overwritten (CONF_HASH_OUTPUT = file) b) be merged with the new hashcode lines (CONF_HASH_OUTPUT = folder) Please make sure that the hashcode format is identical in this case, because otherwise the resulting files will not work for automatic validation using tools like md5sum, etc.
| TaskHashOutput::$OPT_HASH_FILEFORMATS |
|
static |
Initial value:= array(
self::OPT_HASH_FORMAT_GNU => "[@HASHCODE@] [@FILENAME@]\n",
self::OPT_HASH_FORMAT_WIN => "[@HASHCODE@] [@FILENAME@]\r\n",
self::OPT_HASH_FORMAT_MACOS => "[@FILENAME@] [@HASHCODE@]\n",
)
| TaskHashOutput::$OPT_HASH_OUTPUTS |
|
static |
Initial value:= array(
self::OPT_OUTPUT_FILE,
self::OPT_OUTPUT_FOLDER,
)
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/TaskHashOutput.php