CInbox (Common-Inbox)  0.1
Common functionality for ingesting files for archiving.
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes
TaskCopy Class Reference
Inheritance diagram for TaskCopy:
CITask TaskCopyRsync TaskRenameTarget TaskCopyToTarget

List of all members.

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'
const MASK_TARGET_TEMP = 'temp_%s'

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

 $MASK_TARGET_TEMP = self::MASK_TARGET_TEMP
 $updateFolders
 $updateFiles

Detailed Description

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-rd.com)
See also:

Member Function Documentation

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()

Prepare everything so it's ready for processing.

Returns:
bool success True if init went fine, False if an error occurred.

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()


Member Data Documentation

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:
 All Classes Functions Variables