|
CInbox (Common-Inbox)
0.1
Common functionality for ingesting files for archiving.
|
Public Member Functions | |
| __construct (&$CIFolder) | |
| init () | |
| finalize () | |
Public Attributes | |
| 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' |
Static Public Attributes | |
| static | $OPT_UPDATE_FOLDERS |
| static | $OPT_UPDATE_FILES |
Protected Member Functions | |
| loadSettings () | |
| isValidUpdateFolders ($updateMode) | |
| isValidUpdateFiles ($updateMode) | |
| getCmdLogfile () | |
| removeCmdLogfile () | |
| createFolder ($folderName) | |
| move ($source, $target, $overwrite=false) | |
Protected Attributes | |
| $updateFolders | |
| $updateFiles | |
Abstract class containing functions/properties common to Tasks that deal with copying/moving/renaming files from A to B.
| 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;
Reimplemented from CITask.
Reimplemented in TaskRenameTarget.
| TaskCopy::getCmdLogfile | ( | ) | [protected] |
Get filename of logfile to use for external command execution. NOTE: Assumes $this->tempFolder to be set and initialized.
: self::checkTempFolder()
| TaskCopy::init | ( | ) |
Prepare everything so it's ready for processing.
Reimplemented from CITask.
Reimplemented in TaskCopyToTarget.
| 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.
Reimplemented from CITask.
| 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] |
array(
self::OPT_CREATE,
self::OPT_UPDATE,
self::OPT_CREATE_OR_UPDATE,
)
TaskCopy::$OPT_UPDATE_FOLDERS [static] |
array(
self::OPT_CREATE,
self::OPT_UPDATE,
)
1.7.6.1