X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FBaseModule.php;h=1da9397a7833da42e8ab778f8268544c02344f17;hb=be7bd106784ad4e45833b1649e8409ef48f0d19f;hp=08f77555459b43485a5b0ef9498c6cc5aedffff1;hpb=7c470f0be9a0b4a9f8625333345c8b994487b504;p=friendica.git diff --git a/src/BaseModule.php b/src/BaseModule.php index 08f7755545..1da9397a78 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -1,60 +1,72 @@ - + */ +abstract class BaseModule extends BaseObject +{ + /** + * @brief Initialization method common to both content() and post() + * + * Extend this method if you need to do any shared processing before both + * content() or post() + */ + public static function init() + { + } + + /** + * @brief Module GET method to display raw content from technical endpoints + * + * Extend this method if the module is supposed to return communication data, + * e.g. from protocol implementations. + */ + public static function rawContent() + { + } + + /** + * @brief Module GET method to display any content + * + * Extend this method if the module is supposed to return any display + * through a GET request. It can be an HTML page through templating or a + * XML feed or a JSON output. + * + * @return string + */ + public static function content() + { + $o = ''; + + return $o; + } + + /** + * @brief Module POST method to process submitted data + * + * Extend this method if the module is supposed to process POST requests. + * Doesn't display any content + */ + public static function post() + { + // goaway('module'); + } + + /** + * @brief Called after post() + * + * Unknown purpose + */ + public static function afterpost() + { + + } +}