3 * GNU social cronish plugin, to imitate cron actions
7 * @author Mikael Nordfeldth <mmn@hethane.se>
8 * @copyright 2013 Free Software Foundation, Inc.
9 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
10 * @link http://gnu.io/social/
13 if (!defined('GNUSOCIAL')) { exit(1); }
15 class CronishPlugin extends Plugin {
16 public function onCronMinutely()
18 common_debug('CRON: Running near-minutely cron job!');
21 public function onCronHourly()
23 common_debug('CRON: Running near-hourly cron job!');
26 public function onCronDaily()
28 common_debug('CRON: Running near-daily cron job!');
31 public function onCronWeekly()
33 common_debug('CRON: Running near-weekly cron job!');
37 * When the page has finished rendering, let's do some cron jobs
38 * if we have the time.
40 public function onEndActionExecute(Action $action)
42 $cron = new Cronish();
43 $cron->callTimedEvents();
48 public function onPluginVersion(array &$versions)
50 $versions[] = array('name' => 'Cronish',
51 'version' => GNUSOCIAL_VERSION,
52 'author' => 'Mikael Nordfeldth',
53 'homepage' => 'http://www.gnu.org/software/social/',
55 // TRANS: Plugin description.
56 _m('Cronish plugin that executes events on a near-minutely/hour/day/week basis.'));