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