From: Michael Date: Sun, 30 Sep 2018 13:15:10 +0000 (+0000) Subject: There is now "rawContent" for technical endpoints X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a8b776c189e92034ecd252e71b0fc9e5fa364a13;p=friendica.git There is now "rawContent" for technical endpoints --- diff --git a/index.php b/index.php index 8b0bd47251..46b95c75e4 100644 --- a/index.php +++ b/index.php @@ -342,15 +342,21 @@ if ($a->module_loaded) { $a->page['page_title'] = $a->module; $placeholder = ''; + Addon::callHooks($a->module . '_mod_init', $placeholder); + if ($a->module_class) { - Addon::callHooks($a->module . '_mod_init', $placeholder); call_user_func([$a->module_class, 'init']); } else if (function_exists($a->module . '_init')) { - Addon::callHooks($a->module . '_mod_init', $placeholder); $func = $a->module . '_init'; $func($a); } + // "rawContent" is especially meant for technical endpoints. + // This endpoint doesn't need any theme initialization or other comparable stuff. + if (!$a->error && $a->module_class) { + call_user_func([$a->module_class, 'rawContent']); + } + if (function_exists(str_replace('-', '_', $a->getCurrentTheme()) . '_init')) { $func = str_replace('-', '_', $a->getCurrentTheme()) . '_init'; $func($a); diff --git a/src/Module/Followers.php b/src/Module/Followers.php index 80ad68def4..98e9f1e0ee 100644 --- a/src/Module/Followers.php +++ b/src/Module/Followers.php @@ -14,7 +14,7 @@ use Friendica\Model\User; */ class Followers extends BaseModule { - public static function init() + public static function rawContent() { $a = self::getApp(); diff --git a/src/Module/Following.php b/src/Module/Following.php index 091a505cc9..6023db4cbe 100644 --- a/src/Module/Following.php +++ b/src/Module/Following.php @@ -14,7 +14,7 @@ use Friendica\Model\User; */ class Following extends BaseModule { - public static function init() + public static function rawContent() { $a = self::getApp(); diff --git a/src/Module/Inbox.php b/src/Module/Inbox.php index 4fc450d85a..c97c3b7afb 100644 --- a/src/Module/Inbox.php +++ b/src/Module/Inbox.php @@ -15,7 +15,7 @@ use Friendica\Util\HTTPSignature; */ class Inbox extends BaseModule { - public static function init() + public static function rawContent() { $a = self::getApp(); diff --git a/src/Module/Object.php b/src/Module/Object.php index 557b906d2b..05aae84f86 100644 --- a/src/Module/Object.php +++ b/src/Module/Object.php @@ -15,7 +15,7 @@ use Friendica\Database\DBA; */ class Object extends BaseModule { - public static function init() + public static function rawContent() { $a = self::getApp(); diff --git a/src/Module/Outbox.php b/src/Module/Outbox.php index 8ddc861836..f6bad56dd6 100644 --- a/src/Module/Outbox.php +++ b/src/Module/Outbox.php @@ -14,7 +14,7 @@ use Friendica\Model\User; */ class Outbox extends BaseModule { - public static function init() + public static function rawContent() { $a = self::getApp();