]> git.mxchange.org Git - friendica.git/blob - src/BaseModule.php
Merge pull request #5920 from MrPetovan/bug/remove-password-from-register
[friendica.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          * @brief Module GET method to display raw content from technical endpoints
28          *
29          * Extend this method if the module is supposed to return communication data,
30          * e.g. from protocol implementations.
31          */
32         public static function rawContent()
33         {
34         }
35
36         /**
37          * @brief Module GET method to display any content
38          *
39          * Extend this method if the module is supposed to return any display
40          * through a GET request. It can be an HTML page through templating or a
41          * XML feed or a JSON output.
42          *
43          * @return string
44          */
45         public static function content()
46         {
47                 $o = '';
48
49                 return $o;
50         }
51
52         /**
53          * @brief Module POST method to process submitted data
54          *
55          * Extend this method if the module is supposed to process POST requests.
56          * Doesn't display any content
57          */
58         public static function post()
59         {
60                 // goaway('module');
61         }
62
63         /**
64          * @brief Called after post()
65          *
66          * Unknown purpose
67          */
68         public static function afterpost()
69         {
70
71         }
72 }