CInbox (Common-Inbox)  0.1
Common functionality for ingesting files for archiving.
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
TaskExec Class Reference
Inheritance diagram for TaskExec:
CITask TaskPostProcs TaskPreProcs TaskPreProcs2 TaskPreProcs2

List of all members.

Public Member Functions

 __construct (&$CIFolder)

Public Attributes

const TASK_LABEL = 'Execute external programs (abstract)'
Exit codes

Exit-codes of external scripts that represent task states. Task states STATUS_RUNNING and STATUS_UNDEFINED are internal only and therefore not available to external program execution.

NOTE: These numbers are not mapped 1:1 to task states, because application exit codes are defined as: 0 = okay non-0 = error Yet, the same numbers were used wherever possible.

IMPORTANT: All programs/scripts executed by this task must implement these exit codes. Otherwise, a non-0 exitcode might lead to undesired, possibly catastrophic results. If you need to execute an arbitrary program, please use a wrapper-script of some kind to return these exit codes as desired.

const EXIT_STATUS_DONE = 0
 Success! This means the task completed successfully.
const EXIT_STATUS_WAIT = 5
 Task decided that Item is not ready yet and shall be moved back to 'to-do'.
const EXIT_STATUS_PBCT = 6
 There were problems, but the task may continue.
const EXIT_STATUS_PBC = 7
 There were problems, but subsequent task may continue.
const EXIT_STATUS_ERROR = 10
 An error occurred. Abort execution as soon as possible.
const EXIT_STATUS_CONFIG_ERROR = 11
 If a config option was not valid.
const EXIT_STATUS_SKIPPED = 15
 If task was skipped.

Protected Member Functions

 isCmdValid ($command)
 resolveCmd ($command, $arguments=null)
 runScript ($script)
 setStatusByExitcode ($exitCode)

Protected Attributes

 $exec

Detailed Description

Abstract base class for tasks that call external applications.

Author:
Peter Bubestinger-Steindl (pb@av-rd.com)
See also:

Member Function Documentation

TaskExec::isCmdValid ( command) [protected]

Takes a commandline string consisting of program and arguments and checks if the program file exists and is executable.

TaskExec::resolveCmd ( command,
arguments = null 
) [protected]

Resolves placeholders in command string.

TaskExec::runScript ( script) [protected]

Takes the name of a shell-script (or any other command), and executes it after resolving placeholders e.g. as arguments.

TaskExec::setStatusByExitcode ( exitCode) [protected]

Sets the task status according to the given exitcode. This can be used to have external scripts determine tasklist flow.


The documentation for this class was generated from the following file:
 All Classes Functions Variables