71 foreach (
$periods as $period => $interval) {
72 $key =
"cron_latest:$period:ts";
74 $deadline =
$ts + $interval;
76 if ($now > $deadline) {
77 $msg_key =
"cron_latest:$period:msg";
78 $msg =
elgg_echo(
'admin:cron:started', [$period, date(
'r',
time())]);
84 $std_out = ob_get_clean();
86 $period_std_out = $std_out . $old_stdout;
87 $all_std_out .= $period_std_out;
106 if (!isset($page[0])) {
110 $period = strtolower($page[0]);
114 if (($period !=
'run') && !in_array($period, $allowed_periods)) {
115 throw new \CronException(
"$period is not a recognized cron period.");
118 if ($period ==
'run') {
129 $msg_key =
"cron_latest:$period:msg";
130 $msg =
elgg_echo(
'admin:cron:started', [$period, date(
'r',
time())]);
134 $std_out = ob_get_clean();
136 $msg = $std_out . $old_stdout;
159 $key =
"cron_latest:$period:ts";
161 echo elgg_echo(
'admin:cron:complete', [$period, date(
'r', $time)]);
166 $events->registerHandler(
'init',
'system',
'_elgg_cron_init');
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
elgg_get_site_entity($site_guid=0)
Get an entity (default is current site)
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
_elgg_cron_page_handler($page)
Cron handler.
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
elgg_register_plugin_hook_handler($hook, $type, $callback, $priority=500)
_elgg_cron_run()
Cron run.
elgg_register_admin_menu_item($section, $menu_id, $parent_id=null, $priority=100)
Add an admin area section or child section.
elgg_set_config($name, $value)
Set an Elgg configuration value.
elgg echo
Translates a string.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
_elgg_cron_monitor($hook, $period, $output, $params)
Record cron running.
elgg_register_page_handler($identifier, $function)
Registers a page handler for a particular identifier.
_elgg_cron_init()
Cron initialization.