]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Cronish/CronishPlugin.php
Merge branch 'master' into FeedPoller
[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://www.gnu.org/software/social/
11  */
12
13 class CronishPlugin extends Plugin {
14     public function onCronMinutely()
15     {
16         common_debug('CRON: Running minutely cron job!');
17     }
18
19     public function onCronHourly()
20     {
21         common_debug('CRON: Running hourly cron job!');
22     }
23
24     public function onCronDaily()
25     {
26         common_debug('CRON: Running daily cron job!');
27     }
28
29     public function onCronWeekly()
30     {
31         common_debug('CRON: Running weekly cron job!');
32     }
33
34     /**
35      * When the page has finished rendering, let's do some cron jobs
36      * if we have the time.
37      */
38     public function onEndActionExecute($status, Action $action)
39     {
40         $cron = new Cronish(); 
41         $cron->callTimedEvents();
42
43         return true;
44     }
45
46     public function onPluginVersion(&$versions)
47     {
48         $versions[] = array('name' => 'Cronish',
49                             'version' => GNUSOCIAL_VERSION,
50                             'author' => 'Mikael Nordfeldth',
51                             'homepage' => 'http://www.gnu.org/software/social/',
52                             'description' =>
53                             // TRANS: Plugin description.
54                             _m('Cronish plugin that executes events on a near-hour/day/week basis.'));
55         return true;
56     }
57 }