|
|
const | TASK_LABEL = 'Copy files (abstract)' |
| |
|
const | CONF_UPDATE_FOLDERS = 'UPDATE_FOLDERS' |
| |
|
const | CONF_UPDATE_FILES = 'UPDATE_FILES' |
| |
|
const | OPT_CREATE = 'create' |
| |
|
const | OPT_UPDATE = 'update' |
| |
|
const | OPT_CREATE_OR_UPDATE = 'create_or_update' |
| |
|
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_UPDATE_FOLDERS |
| |
| static | $OPT_UPDATE_FILES |
| |
|
|
| $updateFolders |
| |
|
| $updateFiles |
| |
|
| $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).
|
| |
Abstract class containing functions/properties common to Tasks that deal with copying/moving/renaming files from A to B.
- 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
-
| TaskCopy::createFolder |
( |
|
$folderName | ) |
|
|
protected |
Creates a folder. Performs checks before doing so and writes to log. Returns 'true' if folder was created, 'false' if not.
Actions to be performed after run() finished successfully;
| TaskCopy::getCmdLogfile |
( |
| ) |
|
|
protected |
Get filename of logfile to use for external command execution. NOTE: Assumes $this->tempFolder to be set and initialized.
: self::checkTempFolder()
Prepare everything so it's ready for processing.
- Returns
- bool success True if init went fine, False if an error occurred.
| TaskCopy::isValidUpdateFiles |
( |
|
$updateMode | ) |
|
|
protected |
Same as "isValidUpdateFolders()" but for file mode.
| TaskCopy::isValidUpdateFolders |
( |
|
$updateMode | ) |
|
|
protected |
Checks if the given update mode is a valid option. Returns 'true' if it is valid - 'false' if not.
The check is case-sensitive, so you might want to normalize case before calling this.
| TaskCopy::loadSettings |
( |
| ) |
|
|
protected |
Load settings from config that are relevant for this task.
| TaskCopy::move |
( |
|
$source, |
|
|
|
$target, |
|
|
|
$overwrite = false |
|
) |
| |
|
protected |
Renames/moves a file or folder from $source to $target.
It uses the PHP built-in function "rename", but different checks: $overwrite: If false: If $target already exists, exception will be thrown. If true: If $target already exists it will be overwritten by $source.
| TaskCopy::removeCmdLogfile |
( |
| ) |
|
|
protected |
Removes/deletes the logfile used for external command execution. self::getCmdLogfile()
| TaskCopy::$OPT_UPDATE_FILES |
|
static |
Initial value:= array(
self::OPT_CREATE,
self::OPT_UPDATE,
self::OPT_CREATE_OR_UPDATE,
)
| TaskCopy::$OPT_UPDATE_FOLDERS |
|
static |
Initial value:= array(
self::OPT_CREATE,
self::OPT_UPDATE,
)
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/TaskCopy.php