gnu-social/plugins/Cronish/CronishPlugin.php
Mikael Nordfeldth 9400795a5f Cron split into Cronish and OpportunisticQM
/main/cron changed to /main/runqueue

The key-required functionality is not throughly tested yet.
2013-11-20 21:20:42 +01:00

43 lines
1.1 KiB
PHP

<?php
class CronishPlugin extends Plugin {
public function onCronHourly()
{
common_debug('CRON: Running hourly cron job!');
}
public function onCronDaily()
{
common_debug('CRON: Running daily cron job!');
}
public function onCronWeekly()
{
common_debug('CRON: Running weekly cron job!');
}
/**
* When the page has finished rendering, let's do some cron jobs
* if we have the time.
*/
public function onEndActionExecute($status, Action $action)
{
$cron = new Cronish();
$cron->callTimedEvents();
return true;
}
public function onPluginVersion(&$versions)
{
$versions[] = array('name' => 'Cronish',
'version' => GNUSOCIAL_VERSION,
'author' => 'Mikael Nordfeldth',
'homepage' => 'http://www.gnu.org/software/social/',
'description' =>
// TRANS: Plugin description.
_m('Cronish plugin that executes events on a near-hour/day/week basis.'));
return true;
}
}