...
Code Block | ||
---|---|---|
| ||
type = integer(min = 0, max = 1, default = 0) last_run = intigerinteger pulled from lib_database table cron column lastrun time_delta = intigerinteger pulled from lib_database table plugins column $pluginname_cron_name_delta cron_function = string function name to run when cron should be activated function Hook_Cron takes type, time_delta, cron_name returns integer(min = 0, max = 3) variable_declaration $current_time ... statement if $current_time > last_run + time_delta then return(3) else run cron_function statement if cron is running then return(2) statement function failed return 0 function succeeded return 1 ... endfunction |
...