]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Cronish/CronishPlugin.php
[TRANSLATION] Update license and copyright notice in translation files
[quix0rs-gnu-social.git] / plugins / Cronish / CronishPlugin.php
1 <?php
2 /**
3  * GNU social cronish plugin, to imitate cron actions
4  *
5  * @category  Cron
6  * @package   GNUsocial
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/
11  */
12
13 if (!defined('GNUSOCIAL')) { exit(1); }
14
15 class CronishPlugin extends Plugin {
16     const PLUGIN_VERSION = '2.0.0';
17
18     public function onCronMinutely()
19     {
20         common_debug('CRON: Running near-minutely cron job!');
21     }
22
23     public function onCronHourly()
24     {
25         common_debug('CRON: Running near-hourly cron job!');
26     }
27
28     public function onCronDaily()
29     {
30         common_debug('CRON: Running near-daily cron job!');
31     }
32
33     public function onCronWeekly()
34     {
35         common_debug('CRON: Running near-weekly cron job!');
36     }
37
38     /**
39      * When the page has finished rendering, let's do some cron jobs
40      * if we have the time.
41      */
42     public function onEndActionExecute(Action $action)
43     {
44         $cron = new Cronish(); 
45         $cron->callTimedEvents();
46
47         return true;
48     }
49
50     public function onPluginVersion(array &$versions)
51     {
52         $versions[] = array('name' => 'Cronish',
53                             'version' => self::PLUGIN_VERSION,
54                             'author' => 'Mikael Nordfeldth',
55                             'homepage' => 'http://www.gnu.org/software/social/',
56                             'description' =>
57                             // TRANS: Plugin description.
58                             _m('Cronish plugin that executes events on a near-minutely/hour/day/week basis.'));
59         return true;
60     }
61 }