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 CustdataToCustomerAccountsTask CwReloadYesterdayTask DefectorTargetTask DeveloperTargetTask EmailLogParseTask EquityHistoryTask FannieTaskArgs InitLastSold InstaCartTask InventoryTask LaneSyncTask LaneTrimTask LastSoldTask MailChimpTask MonitorsTask NabsTask NotInUseTask OrderGenTask PatronageCheckTask PriceBatchTask PriceDiscrepancyTask ProductSummarizeLastQuarter ProdUpdateMaintenanceTask PullRemoteTransactionsTask PurchaseOrderSummarize ReportDataCacheTask ReportMetricsTask SalesBatchTask SameDayReportingTask SatelliteRedisRecv SatelliteRedisSend SatelliteShipTask ScheduledEmailSendTask SetMemDatesTask SimpleBackupTask SpecialOrdersTask SpinsSubmitTask StaffArPayrollTask TableSnapshotTask TargetPromoTrackingTask TransArchiveTask UIGTask VoidHistoryTask WfcAccessEmailTask WfcClassMenuTask WfcEquityEmailTask WfcVcTask WooCustomersTask WooProductsTask

Public Member Functions

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

Public Attributes

 $name = 'Fannie Task'
 
 $description = 'Information about the task'
 
 $default_schedule
 
 $schedulable = true
 
 $log_start_stop = 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()
 
 $test_mode = false
 

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' => '*',
)
FannieTask::$log_start_stop = true

Normally the start and stop time of a task is automatically logged. This can be helpful to verify a task a) actually ran and b) completed without crashing. However for tasks that run very frequently this can generate excess log noise.


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