CORE POS - Fannie
The CORE POS back end
Public Member Functions | Public Attributes | Protected Attributes | List of all members
FannieTask Class Reference
Inheritance diagram for FannieTask:
AddIDsToOldTransactions ArHistoryTask AutoParsTask CalendarSubscriptionsTask ConvertArchiveMonthlyToPartitions CoopCredHistoryTask CoopCredLaneSyncTask CoopCredUpdateBalanceTask CwReloadYesterdayTask EmailLogParseTask EquityHistoryTask FannieTaskArgs GiterateTask LaneSyncTask MailChimpTask NabsTask PatronageCheckTask ProductSummarizeLastQuarter ProdUpdateMaintenanceTask PullRemoteTransactionsTask PurchaseOrderSummarize ReportDataCacheTask SalesBatchTask SelectInvoiceTask SimpleBackupTask SpinsSubmitTask StaffArPayrollTask TableSnapshotTask TransArchiveTask UIGTask WfcClassMenuTask WfcVcTask

Public Member Functions

 setThreshold ($t)
 
 setConfig (FannieConfig $fc)
 
 setLogger (FannieLogger $fl)
 
 setOptions ($o)
 
 setArguments ($a)
 
 run ()
 
 cronMsg ($str, $severity=6)
 
 lazyGetOpt ($argv)
 

Public Attributes

 $name = 'Fannie Task'
 
 $description = 'Information about the task'
 
 $default_schedule
 
 $schedulable = true
 
const TASK_NO_ERROR = 0
 
const TASK_TRIVIAL_ERROR = 1
 
const TASK_SMALL_ERROR = 2
 
const TASK_MEDIUM_ERROR = 3
 
const TASK_LARGE_ERROR = 4
 
const TASK_WORST_ERROR = 5
 

Protected Attributes

 $error_threshold = 99
 
 $config = null
 
 $logger = null
 
 $options = array()
 
 $arguments = array()
 

Detailed Description

Base class for scheduled tasks

Member Function Documentation

FannieTask::cronMsg (   $str,
  $severity = 6 
)

Write message to log and if necessary raise it to stderr to trigger an email

Parameters
$strmessage string
$severity[optional, default 6/info] message importance
Returns
empty string
FannieTask::lazyGetOpt (   $argv)

getopt style parsing. not fully posix compliant.

Parameters
$argv[array] of options and arguments
Returns
[array]
  • options [array] of option names and values
  • arguments [array] of non-option arguments

Example: php FannieTask.php SomeTask -v –verbose -h 1 –host=1 something else

lazyGetOpt returns

  • options "-v" => true "--verbose" => true "-h" => 1 "--host" => 1
  • arguments 0 => "something" 1 => "else"
FannieTask::run ( )

Implement task functionality here

Member Data Documentation

FannieTask::$default_schedule
Initial value:
= array(
'min' => 0,
'hour' => 0,
'day' => 1,
'month' => 1,
'weekday' => '*',
)

The documentation for this class was generated from the following file: