]> git.mxchange.org Git - friendica.git/blob - src/Capabilities/ICanHandleRequests.php
Merge pull request #10977 from nupplaphil/feat/dynamic_modules
[friendica.git] / src / Capabilities / ICanHandleRequests.php
1 <?php
2
3 namespace Friendica\Capabilities;
4
5 /**
6  * This interface provides the capability to handle requests from clients and returns the desired outcome
7  */
8 interface ICanHandleRequests
9 {
10         /**
11          * Initialization method common to both content() and post()
12          *
13          * Extend this method if you need to do any shared processing before either
14          * content() or post()
15          */
16         public function init();
17
18         /**
19          * Module GET method to display raw content from technical endpoints
20          *
21          * Extend this method if the module is supposed to return communication data,
22          * e.g. from protocol implementations.
23          */
24         public function rawContent();
25
26         /**
27          * Module GET method to display any content
28          *
29          * Extend this method if the module is supposed to return any display
30          * through a GET request. It can be an HTML page through templating or a
31          * XML feed or a JSON output.
32          */
33         public function content(): string;
34
35         /**
36          * Module DELETE method to process submitted data
37          *
38          * Extend this method if the module is supposed to process DELETE requests.
39          * Doesn't display any content
40          */
41         public function delete();
42
43         /**
44          * Module PATCH method to process submitted data
45          *
46          * Extend this method if the module is supposed to process PATCH requests.
47          * Doesn't display any content
48          */
49         public function patch();
50
51         /**
52          * Module POST method to process submitted data
53          *
54          * Extend this method if the module is supposed to process POST requests.
55          * Doesn't display any content
56          */
57         public function post();
58
59         /**
60          * Module PUT method to process submitted data
61          *
62          * Extend this method if the module is supposed to process PUT requests.
63          * Doesn't display any content
64          */
65         public function put();
66
67         public function getClassName(): string;
68 }