Update "mrpetovan" email address
[friendica.git/.git] / src / BaseModule.php
1 <?php
2
3 namespace Friendica;
4
5 /**
6  * All modules in Friendica should extend BaseModule, although not all modules
7  * need to extend all the methods described here
8  *
9  * The filename of the module in src/Module needs to match the class name
10  * exactly to make the module available.
11  *
12  * @author Hypolite Petovan <hypolite@mrpetovan.com>
13  */
14 abstract class BaseModule extends BaseObject
15 {
16         /**
17          * @brief Initialization method common to both content() and post()
18          *
19          * Extend this method if you need to do any shared processing before both
20          * content() or post()
21          */
22         public static function init()
23         {
24
25         }
26
27         /**
28          * @brief Module GET method to display any content
29          *
30          * Extend this method if the module is supposed to return any display
31          * through a GET request. It can be an HTML page through templating or a
32          * XML feed or a JSON output.
33          *
34          * @return string
35          */
36         public static function content()
37         {
38                 $o = '';
39
40                 return $o;
41         }
42
43         /**
44          * @brief Module POST method to process submitted data
45          *
46          * Extend this method if the module is supposed to process POST requests.
47          * Doesn't display any content
48          */
49         public static function post()
50         {
51                 // goaway('module');
52         }
53
54         /**
55          * @brief Called after post()
56          *
57          * Unknown purpose
58          */
59         public static function afterpost()
60         {
61
62         }
63 }