]> git.mxchange.org Git - friendica.git/commitdiff
Make `BaseModule` a real entity
authorPhilipp <admin@philipp.info>
Sat, 20 Nov 2021 14:38:03 +0000 (15:38 +0100)
committerPhilipp <admin@philipp.info>
Sat, 27 Nov 2021 11:40:36 +0000 (12:40 +0100)
- Add all dependencies, necessary to run the content (baseUrl, Arguments)
- Encapsulate all POST/GET/DELETE/PATCH/PUT methods as protected methods inside the BaseModule
- Return Module content ONLY per `BaseModule::run()` (including the Hook logic there as well)

252 files changed:
src/App.php
src/App/Page.php
src/App/Router.php
src/BaseModule.php
src/Capabilities/ICanHandleRequests.php
src/LegacyModule.php
src/Module/AccountManagementControlDocument.php
src/Module/Acctlink.php
src/Module/ActivityPub/Followers.php
src/Module/ActivityPub/Following.php
src/Module/ActivityPub/Inbox.php
src/Module/ActivityPub/Objects.php
src/Module/ActivityPub/Outbox.php
src/Module/Admin/Addons/Details.php
src/Module/Admin/Addons/Index.php
src/Module/Admin/Blocklist/Contact.php
src/Module/Admin/Blocklist/Server/Add.php
src/Module/Admin/Blocklist/Server/Index.php
src/Module/Admin/DBSync.php
src/Module/Admin/Features.php
src/Module/Admin/Federation.php
src/Module/Admin/Item/Delete.php
src/Module/Admin/Item/Source.php
src/Module/Admin/Logs/Settings.php
src/Module/Admin/Logs/View.php
src/Module/Admin/PhpInfo.php
src/Module/Admin/Queue.php
src/Module/Admin/Site.php
src/Module/Admin/Storage.php
src/Module/Admin/Summary.php
src/Module/Admin/Themes/Details.php
src/Module/Admin/Themes/Embed.php
src/Module/Admin/Themes/Index.php
src/Module/Admin/Tos.php
src/Module/Admin/Users/Active.php
src/Module/Admin/Users/Blocked.php
src/Module/Admin/Users/Create.php
src/Module/Admin/Users/Deleted.php
src/Module/Admin/Users/Index.php
src/Module/Admin/Users/Pending.php
src/Module/Api/Friendica/Activity.php
src/Module/Api/Friendica/DirectMessages/Setseen.php
src/Module/Api/Friendica/Events/Index.php
src/Module/Api/Friendica/Group/Delete.php
src/Module/Api/Friendica/Index.php
src/Module/Api/Friendica/Notification.php
src/Module/Api/Friendica/Photo/Delete.php
src/Module/Api/Friendica/Photoalbum/Delete.php
src/Module/Api/Friendica/Photoalbum/Update.php
src/Module/Api/Friendica/Profile/Show.php
src/Module/Api/GNUSocial/GNUSocial/Config.php
src/Module/Api/GNUSocial/GNUSocial/Version.php
src/Module/Api/GNUSocial/Help/Test.php
src/Module/Api/Mastodon/Accounts.php
src/Module/Api/Mastodon/Accounts/Block.php
src/Module/Api/Mastodon/Accounts/FeaturedTags.php
src/Module/Api/Mastodon/Accounts/Follow.php
src/Module/Api/Mastodon/Accounts/Followers.php
src/Module/Api/Mastodon/Accounts/Following.php
src/Module/Api/Mastodon/Accounts/IdentityProofs.php
src/Module/Api/Mastodon/Accounts/Lists.php
src/Module/Api/Mastodon/Accounts/Mute.php
src/Module/Api/Mastodon/Accounts/Note.php
src/Module/Api/Mastodon/Accounts/Relationships.php
src/Module/Api/Mastodon/Accounts/Search.php
src/Module/Api/Mastodon/Accounts/Statuses.php
src/Module/Api/Mastodon/Accounts/Unblock.php
src/Module/Api/Mastodon/Accounts/Unfollow.php
src/Module/Api/Mastodon/Accounts/Unmute.php
src/Module/Api/Mastodon/Accounts/UpdateCredentials.php
src/Module/Api/Mastodon/Accounts/VerifyCredentials.php
src/Module/Api/Mastodon/Announcements.php
src/Module/Api/Mastodon/Apps.php
src/Module/Api/Mastodon/Apps/VerifyCredentials.php
src/Module/Api/Mastodon/Blocks.php
src/Module/Api/Mastodon/Bookmarks.php
src/Module/Api/Mastodon/Conversations.php
src/Module/Api/Mastodon/Conversations/Read.php
src/Module/Api/Mastodon/CustomEmojis.php
src/Module/Api/Mastodon/Directory.php
src/Module/Api/Mastodon/Endorsements.php
src/Module/Api/Mastodon/Favourited.php
src/Module/Api/Mastodon/Filters.php
src/Module/Api/Mastodon/FollowRequests.php
src/Module/Api/Mastodon/Instance.php
src/Module/Api/Mastodon/Instance/Peers.php
src/Module/Api/Mastodon/Instance/Rules.php
src/Module/Api/Mastodon/Lists.php
src/Module/Api/Mastodon/Lists/Accounts.php
src/Module/Api/Mastodon/Markers.php
src/Module/Api/Mastodon/Media.php
src/Module/Api/Mastodon/Mutes.php
src/Module/Api/Mastodon/Notifications.php
src/Module/Api/Mastodon/Notifications/Clear.php
src/Module/Api/Mastodon/Notifications/Dismiss.php
src/Module/Api/Mastodon/Preferences.php
src/Module/Api/Mastodon/Proofs.php
src/Module/Api/Mastodon/PushSubscription.php
src/Module/Api/Mastodon/ScheduledStatuses.php
src/Module/Api/Mastodon/Search.php
src/Module/Api/Mastodon/Statuses.php
src/Module/Api/Mastodon/Statuses/Bookmark.php
src/Module/Api/Mastodon/Statuses/Card.php
src/Module/Api/Mastodon/Statuses/Context.php
src/Module/Api/Mastodon/Statuses/Favourite.php
src/Module/Api/Mastodon/Statuses/FavouritedBy.php
src/Module/Api/Mastodon/Statuses/Mute.php
src/Module/Api/Mastodon/Statuses/Pin.php
src/Module/Api/Mastodon/Statuses/Reblog.php
src/Module/Api/Mastodon/Statuses/RebloggedBy.php
src/Module/Api/Mastodon/Statuses/Unbookmark.php
src/Module/Api/Mastodon/Statuses/Unfavourite.php
src/Module/Api/Mastodon/Statuses/Unmute.php
src/Module/Api/Mastodon/Statuses/Unpin.php
src/Module/Api/Mastodon/Statuses/Unreblog.php
src/Module/Api/Mastodon/Suggestions.php
src/Module/Api/Mastodon/Timelines/Direct.php
src/Module/Api/Mastodon/Timelines/Home.php
src/Module/Api/Mastodon/Timelines/ListTimeline.php
src/Module/Api/Mastodon/Timelines/PublicTimeline.php
src/Module/Api/Mastodon/Timelines/Tag.php
src/Module/Api/Mastodon/Trends.php
src/Module/Api/Mastodon/Unimplemented.php
src/Module/Api/Twitter/Account/RateLimitStatus.php
src/Module/Api/Twitter/ContactEndpoint.php
src/Module/Api/Twitter/Followers/Ids.php
src/Module/Api/Twitter/Followers/Lists.php
src/Module/Api/Twitter/Friends/Ids.php
src/Module/Api/Twitter/Friends/Lists.php
src/Module/Api/Twitter/SavedSearches.php
src/Module/Apps.php
src/Module/Attach.php
src/Module/BaseAdmin.php
src/Module/BaseApi.php
src/Module/BaseNotifications.php
src/Module/BaseSettings.php
src/Module/Bookmarklet.php
src/Module/Contact.php
src/Module/Contact/Advanced.php
src/Module/Contact/Contacts.php
src/Module/Contact/Hovercard.php
src/Module/Contact/Media.php
src/Module/Contact/Poke.php
src/Module/Contact/Revoke.php
src/Module/Conversation/Community.php
src/Module/Conversation/Network.php
src/Module/Credits.php
src/Module/DFRN/Notify.php
src/Module/DFRN/Poll.php
src/Module/Debug/ActivityPubConversion.php
src/Module/Debug/Babel.php
src/Module/Debug/Feed.php
src/Module/Debug/ItemBody.php
src/Module/Debug/Localtime.php
src/Module/Debug/Probe.php
src/Module/Debug/WebFinger.php
src/Module/Delegation.php
src/Module/Diaspora/Fetch.php
src/Module/Diaspora/Receive.php
src/Module/Directory.php
src/Module/Events/Json.php
src/Module/Feed.php
src/Module/Filer/RemoveTag.php
src/Module/Filer/SaveTag.php
src/Module/FollowConfirm.php
src/Module/FriendSuggest.php
src/Module/Friendica.php
src/Module/Group.php
src/Module/HCard.php
src/Module/HTTPException/MethodNotAllowed.php
src/Module/HTTPException/PageNotFound.php
src/Module/Hashtag.php
src/Module/Help.php
src/Module/Home.php
src/Module/Install.php
src/Module/Invite.php
src/Module/Item/Activity.php
src/Module/Item/Compose.php
src/Module/Item/Follow.php
src/Module/Item/Ignore.php
src/Module/Item/Pin.php
src/Module/Item/Star.php
src/Module/Magic.php
src/Module/Maintenance.php
src/Module/Manifest.php
src/Module/NoScrape.php
src/Module/NodeInfo110.php
src/Module/NodeInfo120.php
src/Module/NodeInfo210.php
src/Module/Notifications/Introductions.php
src/Module/Notifications/Notification.php
src/Module/Notifications/Notifications.php
src/Module/OAuth/Acknowledge.php
src/Module/OAuth/Authorize.php
src/Module/OAuth/Revoke.php
src/Module/OAuth/Token.php
src/Module/Oembed.php
src/Module/OpenSearch.php
src/Module/Owa.php
src/Module/ParseUrl.php
src/Module/PermissionTooltip.php
src/Module/Photo.php
src/Module/Profile/Common.php
src/Module/Profile/Contacts.php
src/Module/Profile/Index.php
src/Module/Profile/Media.php
src/Module/Profile/Profile.php
src/Module/Profile/Schedule.php
src/Module/Profile/Status.php
src/Module/Proxy.php
src/Module/PublicRSAKey.php
src/Module/RandomProfile.php
src/Module/ReallySimpleDiscovery.php
src/Module/Register.php
src/Module/RemoteFollow.php
src/Module/RobotsTxt.php
src/Module/Search/Acl.php
src/Module/Search/Directory.php
src/Module/Search/Filed.php
src/Module/Search/Index.php
src/Module/Search/Saved.php
src/Module/Security/Login.php
src/Module/Security/Logout.php
src/Module/Security/OpenID.php
src/Module/Security/TwoFactor/Recovery.php
src/Module/Security/TwoFactor/Verify.php
src/Module/Settings/Delegation.php
src/Module/Settings/Display.php
src/Module/Settings/Profile/Index.php
src/Module/Settings/Profile/Photo/Crop.php
src/Module/Settings/Profile/Photo/Index.php
src/Module/Settings/TwoFactor/AppSpecific.php
src/Module/Settings/TwoFactor/Index.php
src/Module/Settings/TwoFactor/Recovery.php
src/Module/Settings/TwoFactor/Trusted.php
src/Module/Settings/TwoFactor/Verify.php
src/Module/Settings/UserExport.php
src/Module/Smilies.php
src/Module/Statistics.php
src/Module/Theme.php
src/Module/ThemeDetails.php
src/Module/ToggleMobile.php
src/Module/Tos.php
src/Module/Update/Community.php
src/Module/Update/Network.php
src/Module/Update/Profile.php
src/Module/Welcome.php
src/Module/WellKnown/HostMeta.php
src/Module/WellKnown/NodeInfo.php
src/Module/WellKnown/SecurityTxt.php
src/Module/WellKnown/XSocialRelay.php
src/Module/Xrd.php

index 9083e98ad641d7195da9def4b7e81238d43be65f..14980896efe7e22b1d25e28a4c418d3ab23b5fcd 100644 (file)
@@ -116,11 +116,6 @@ class App
         */
        private $args;
 
-       /**
-        * @var Core\System The system methods
-        */
-       private $system;
-
        /**
         * @var IManagePersonalConfigValues
         */
@@ -326,10 +321,9 @@ class App
         * @param Profiler                    $profiler The profiler of this application
         * @param L10n                        $l10n     The translator instance
         * @param App\Arguments               $args     The Friendica Arguments of the call
-        * @param Core\System                 $system   The system methods
         * @param IManagePersonalConfigValues $pConfig  Personal configuration
         */
-       public function __construct(Database $database, IManageConfigValues $config, App\Mode $mode, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, Core\System $system, IManagePersonalConfigValues $pConfig)
+       public function __construct(Database $database, IManageConfigValues $config, App\Mode $mode, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, IManagePersonalConfigValues $pConfig)
        {
                $this->database = $database;
                $this->config   = $config;
@@ -339,7 +333,6 @@ class App
                $this->logger   = $logger;
                $this->l10n     = $l10n;
                $this->args     = $args;
-               $this->system   = $system;
                $this->pConfig  = $pConfig;
 
                $this->load();
@@ -608,7 +601,7 @@ class App
                                        // Only continue when the given profile link seems valid
                                        // Valid profile links contain a path with "/profile/" and no query parameters
                                        if ((parse_url($_GET['zrl'], PHP_URL_QUERY) == "") &&
-                                           strstr(parse_url($_GET['zrl'], PHP_URL_PATH), "/profile/")) {
+                                               strstr(parse_url($_GET['zrl'], PHP_URL_PATH), "/profile/")) {
                                                if (Core\Session::get('visitor_home') != $_GET["zrl"]) {
                                                        Core\Session::set('my_url', $_GET['zrl']);
                                                        Core\Session::set('authenticated', 0);
@@ -700,7 +693,7 @@ class App
                        $page['page_title'] = $moduleName;
 
                        if (!$this->mode->isInstall() && !$this->mode->has(App\Mode::MAINTENANCEDISABLED)) {
-                               $module = new Maintenance($this->l10n);
+                               $module = $router->getModule(Maintenance::class);
                        } else {
                                // determine the module class and save it to the module instance
                                // @todo there's an implicit dependency due SESSION::start(), so it has to be called here (yet)
@@ -708,12 +701,11 @@ class App
                        }
 
                        // Let the module run it's internal process (init, get, post, ...)
-                       $module->run($this->baseURL, $this->args, $this->logger, $this->profiler, $_SERVER, $_POST);
+                       $content = $module->run($_POST, $_REQUEST);
+                       $page->run($this, $this->baseURL, $this->args, $this->mode, $content, $this->l10n, $this->profiler, $this->config, $pconfig);
                } catch (HTTPException $e) {
                        (new ModuleHTTPException())->rawContent($e);
                }
-
-               $page->run($this, $this->baseURL, $this->args, $this->mode, $module, $this->l10n, $this->profiler, $this->config, $pconfig);
        }
 
        /**
index 0efdc120510f7f08c8ffcb60c18d5979a44b94cc..d302ef6c24770f2b3d8ef2ac63e3e6cca7edfcd6 100644 (file)
@@ -25,7 +25,6 @@ use ArrayAccess;
 use DOMDocument;
 use DOMXPath;
 use Friendica\App;
-use Friendica\Capabilities\ICanHandleRequests;
 use Friendica\Content\Nav;
 use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
@@ -33,7 +32,6 @@ use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Core\Theme;
-use Friendica\Module\Special\HTTPException as ModuleHTTPException;
 use Friendica\Network\HTTPException;
 use Friendica\Util\Network;
 use Friendica\Util\Strings;
@@ -269,9 +267,9 @@ class Page implements ArrayAccess
                if (!empty($_SERVER["HTTPS"]) && ($_SERVER["HTTPS"] == "on")) {
                        $pageURL .= "s";
                }
-       
+
                $pageURL .= "://";
-       
+
                if ($_SERVER["SERVER_PORT"] != "80" && $_SERVER["SERVER_PORT"] != "443") {
                        $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
                } else {
@@ -338,24 +336,13 @@ class Page implements ArrayAccess
         * - module content
         * - hooks for content
         *
-        * @param ICanHandleRequests $module The module
-        * @param Mode             $mode   The Friendica execution mode
+        * @param string $content The content to print
+        * @param Mode   $mode   The Friendica execution mode
         *
         * @throws HTTPException\InternalServerErrorException
         */
-       private function initContent(ICanHandleRequests $module, Mode $mode)
+       private function initContent(string $content, Mode $mode)
        {
-               $content = '';
-
-               try {
-                       $arr = ['content' => $content];
-                       Hook::callAll($module->getClassName() . '_mod_content', $arr);
-                       $content = $arr['content'];
-                       $content .= $module->content();
-               } catch (HTTPException $e) {
-                       $content = (new ModuleHTTPException())->content($e);
-               }
-
                // initialise content region
                if ($mode->isNormal()) {
                        Hook::callAll('page_content_top', $this->page['content']);
@@ -390,14 +377,14 @@ class Page implements ArrayAccess
         * @param BaseURL                     $baseURL The Friendica Base URL
         * @param Arguments                   $args    The Friendica App arguments
         * @param Mode                        $mode    The current node mode
-        * @param ICanHandleRequests          $module  The loaded Friendica module
+        * @param string                      $content The content to print on frontend
         * @param L10n                        $l10n    The l10n language class
         * @param IManageConfigValues         $config  The Configuration of this node
         * @param IManagePersonalConfigValues $pconfig The personal/user configuration
         *
-        * @throws HTTPException\InternalServerErrorException
+        * @throws HTTPException\InternalServerErrorException|HTTPException\ServiceUnavailableException
         */
-       public function run(App $app, BaseURL $baseURL, Arguments $args, Mode $mode, ICanHandleRequests $module, L10n $l10n, Profiler $profiler, IManageConfigValues $config, IManagePersonalConfigValues $pconfig)
+       public function run(App $app, BaseURL $baseURL, Arguments $args, Mode $mode, string $content, L10n $l10n, Profiler $profiler, IManageConfigValues $config, IManagePersonalConfigValues $pconfig)
        {
                $moduleName = $args->getModuleName();
 
@@ -407,7 +394,7 @@ class Page implements ArrayAccess
                 * Sets the $Page->page['content'] variable
                 */
                $timestamp = microtime(true);
-               $this->initContent($module, $mode);
+               $this->initContent($content, $mode);
                $profiler->set(microtime(true) - $timestamp, 'content');
 
                // Load current theme info after module has been initialized as theme could have been set in module
index 880f9a2f885631ae70f333be55a402d64aa943b5..b13334ae08ec083e8983677ce033933afde065ab 100644 (file)
@@ -39,6 +39,7 @@ use Friendica\Module\HTTPException\MethodNotAllowed;
 use Friendica\Module\HTTPException\PageNotFound;
 use Friendica\Network\HTTPException;
 use Friendica\Network\HTTPException\MethodNotAllowedException;
+use Friendica\Network\HTTPException\NoContentException;
 use Friendica\Network\HTTPException\NotFoundException;
 
 /**
@@ -103,6 +104,9 @@ class Router
        /** @var string */
        private $baseRoutesFilepath;
 
+       /** @var array */
+       private $server;
+
        /**
         * @param array               $server             The $_SERVER variable
         * @param string              $baseRoutesFilepath The path to a base routes file to leverage cache, can be empty
@@ -123,8 +127,17 @@ class Router
                $this->args = $args;
                $this->config = $config;
                $this->dice = $dice;
+               $this->server = $server;
+
+               $httpMethod = $this->server['REQUEST_METHOD'] ?? self::GET;
+
+               // @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS
+               // @todo Check allowed methods per requested path
+               if ($httpMethod === static::OPTIONS) {
+                       header('Allow: ' . implode(',', Router::ALLOWED_METHODS));
+                       throw new NoContentException();
+               }
 
-               $httpMethod = $server['REQUEST_METHOD'] ?? self::GET;
                $this->httpMethod = in_array($httpMethod, self::ALLOWED_METHODS) ? $httpMethod : self::GET;
 
                $this->routeCollector = isset($routeCollector) ?
@@ -268,10 +281,9 @@ class Router
                return $moduleClass;
        }
 
-       public function getModule(): ICanHandleRequests
+       public function getModule(?string $module_class = null): ICanHandleRequests
        {
-               $module_class      = null;
-               $module_parameters = [];
+               $module_parameters = [$this->server];
                /**
                 * ROUTING
                 *
@@ -279,7 +291,7 @@ class Router
                 * post() and/or content() static methods can be respectively called to produce a data change or an output.
                 **/
                try {
-                       $module_class        = $this->getModuleClass();
+                       $module_class        = $module_class ?? $this->getModuleClass();
                        $module_parameters[] = $this->parameters;
                } catch (MethodNotAllowedException $e) {
                        $module_class = MethodNotAllowed::class;
index 9b3bd8a5703d4c9f140a39ab97caa927c59fd15c..65fc8f307c49dbdca624c43dd11072dfa4956a95 100644 (file)
@@ -23,11 +23,12 @@ namespace Friendica;
 
 use Friendica\App\Router;
 use Friendica\Capabilities\ICanHandleRequests;
+use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Model\User;
-use Friendica\Module\HTTPException\PageNotFound;
-use Friendica\Network\HTTPException\NoContentException;
+use Friendica\Module\Special\HTTPException as ModuleHTTPException;
+use Friendica\Network\HTTPException;
 use Friendica\Util\Profiler;
 use Psr\Log\LoggerInterface;
 
@@ -44,14 +45,28 @@ abstract class BaseModule implements ICanHandleRequests
 {
        /** @var array */
        protected $parameters = [];
-
        /** @var L10n */
        protected $l10n;
+       /** @var App\BaseURL */
+       protected $baseUrl;
+       /** @var App\Arguments */
+       protected $args;
+       /** @var LoggerInterface */
+       protected $logger;
+       /** @var Profiler */
+       protected $profiler;
+       /** @var array */
+       protected $server;
 
-       public function __construct(L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, array $server, array $parameters = [])
        {
                $this->parameters = $parameters;
                $this->l10n       = $l10n;
+               $this->baseUrl    = $baseUrl;
+               $this->args       = $args;
+               $this->logger     = $logger;
+               $this->profiler   = $profiler;
+               $this->server     = $server;
        }
 
        /**
@@ -75,48 +90,75 @@ abstract class BaseModule implements ICanHandleRequests
        }
 
        /**
-        * {@inheritDoc}
+        * 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.
+        *
+        * @param string[] $request The $_REQUEST content
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                // echo '';
                // exit;
        }
 
        /**
-        * {@inheritDoc}
+        * 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.
+        *
+        * @param string[] $request The $_REQUEST content
         */
-       public function content(): string
+       protected function content(array $request = []): string
        {
                return '';
        }
 
        /**
-        * {@inheritDoc}
+        * Module DELETE method to process submitted data
+        *
+        * Extend this method if the module is supposed to process DELETE requests.
+        * Doesn't display any content
         */
-       public function delete()
+       protected function delete()
        {
        }
 
        /**
-        * {@inheritDoc}
+        * Module PATCH method to process submitted data
+        *
+        * Extend this method if the module is supposed to process PATCH requests.
+        * Doesn't display any content
         */
-       public function patch()
+       protected function patch()
        {
        }
 
        /**
-        * {@inheritDoc}
+        * Module POST method to process submitted data
+        *
+        * Extend this method if the module is supposed to process POST requests.
+        * Doesn't display any content
+        *
+        * @param string[] $request The $_REQUEST content
+        * @param string[] $post    The $_POST content
+        *
         */
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
-               // DI::baseurl()->redirect('module');
+               // $this->baseUrl->redirect('module');
        }
 
        /**
-        * {@inheritDoc}
+        * Module PUT method to process submitted data
+        *
+        * Extend this method if the module is supposed to process PUT requests.
+        * Doesn't display any content
         */
-       public function put()
+       protected function put()
        {
        }
 
@@ -126,92 +168,73 @@ abstract class BaseModule implements ICanHandleRequests
                return static::class;
        }
 
-       public function run(App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, array $server, array $post)
+       /**
+        * {@inheritDoc}
+        */
+       public function run(array $post = [], array $request = []): string
        {
-               /* The URL provided does not resolve to a valid module.
-                *
-                * On Dreamhost sites, quite often things go wrong for no apparent reason and they send us to '/internal_error.html'.
-                * We don't like doing this, but as it occasionally accounts for 10-20% or more of all site traffic -
-                * we are going to trap this and redirect back to the requested page. As long as you don't have a critical error on your page
-                * this will often succeed and eventually do the right thing.
-                *
-                * Otherwise we are going to emit a 404 not found.
-                */
-               if (static::class === PageNotFound::class) {
-                       $queryString = $server['QUERY_STRING'];
-                       // Stupid browser tried to pre-fetch our Javascript img template. Don't log the event or return anything - just quietly exit.
-                       if (!empty($queryString) && preg_match('/{[0-9]}/', $queryString) !== 0) {
-                               exit();
-                       }
-
-                       if (!empty($queryString) && ($queryString === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
-                               $logger->info('index.php: dreamhost_error_hack invoked.', ['Original URI' => $server['REQUEST_URI']]);
-                               $baseUrl->redirect($server['REQUEST_URI']);
-                       }
-
-                       $logger->debug('index.php: page not found.', ['request_uri' => $server['REQUEST_URI'], 'address' => $server['REMOTE_ADDR'], 'query' => $server['QUERY_STRING']]);
-               }
-
                // @see https://github.com/tootsuite/mastodon/blob/c3aef491d66aec743a3a53e934a494f653745b61/config/initializers/cors.rb
-               if (substr($_REQUEST['pagename'] ?? '', 0, 12) == '.well-known/') {
+               if (substr($request['pagename'] ?? '', 0, 12) == '.well-known/') {
                        header('Access-Control-Allow-Origin: *');
                        header('Access-Control-Allow-Headers: *');
                        header('Access-Control-Allow-Methods: ' . Router::GET);
                        header('Access-Control-Allow-Credentials: false');
-               } elseif (substr($_REQUEST['pagename'] ?? '', 0, 8) == 'profile/') {
+               } elseif (substr($request['pagename'] ?? '', 0, 8) == 'profile/') {
                        header('Access-Control-Allow-Origin: *');
                        header('Access-Control-Allow-Headers: *');
                        header('Access-Control-Allow-Methods: ' . Router::GET);
                        header('Access-Control-Allow-Credentials: false');
-               } elseif (substr($_REQUEST['pagename'] ?? '', 0, 4) == 'api/') {
+               } elseif (substr($request['pagename'] ?? '', 0, 4) == 'api/') {
                        header('Access-Control-Allow-Origin: *');
                        header('Access-Control-Allow-Headers: *');
                        header('Access-Control-Allow-Methods: ' . implode(',', Router::ALLOWED_METHODS));
                        header('Access-Control-Allow-Credentials: false');
                        header('Access-Control-Expose-Headers: Link');
-               } elseif (substr($_REQUEST['pagename'] ?? '', 0, 11) == 'oauth/token') {
+               } elseif (substr($request['pagename'] ?? '', 0, 11) == 'oauth/token') {
                        header('Access-Control-Allow-Origin: *');
                        header('Access-Control-Allow-Headers: *');
                        header('Access-Control-Allow-Methods: ' . Router::POST);
                        header('Access-Control-Allow-Credentials: false');
                }
 
-               // @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS
-               // @todo Check allowed methods per requested path
-               if ($server['REQUEST_METHOD'] === Router::OPTIONS) {
-                       header('Allow: ' . implode(',', Router::ALLOWED_METHODS));
-                       throw new NoContentException();
-               }
-
                $placeholder = '';
 
-               $profiler->set(microtime(true), 'ready');
+               $this->profiler->set(microtime(true), 'ready');
                $timestamp = microtime(true);
 
-               Core\Hook::callAll($args->getModuleName() . '_mod_init', $placeholder);
+               Core\Hook::callAll($this->args->getModuleName() . '_mod_init', $placeholder);
 
-               $profiler->set(microtime(true) - $timestamp, 'init');
+               $this->profiler->set(microtime(true) - $timestamp, 'init');
 
-               if ($server['REQUEST_METHOD'] === Router::DELETE) {
+               if ($this->server['REQUEST_METHOD'] === Router::DELETE) {
                        $this->delete();
                }
 
-               if ($server['REQUEST_METHOD'] === Router::PATCH) {
+               if ($this->server['REQUEST_METHOD'] === Router::PATCH) {
                        $this->patch();
                }
 
-               if ($server['REQUEST_METHOD'] === Router::POST) {
-                       Core\Hook::callAll($args->getModuleName() . '_mod_post', $post);
-                       $this->post();
+               if ($this->server['REQUEST_METHOD'] === Router::POST) {
+                       Core\Hook::callAll($this->args->getModuleName() . '_mod_post', $post);
+                       $this->post($request, $post);
                }
 
-               if ($server['REQUEST_METHOD'] === Router::PUT) {
+               if ($this->server['REQUEST_METHOD'] === Router::PUT) {
                        $this->put();
                }
 
                // "rawContent" is especially meant for technical endpoints.
                // This endpoint doesn't need any theme initialization or other comparable stuff.
-               $this->rawContent();
+               $this->rawContent($request);
+
+               try {
+                       $arr = ['content' => ''];
+                       Hook::callAll(static::class . '_mod_content', $arr);
+                       $content = $arr['content'];
+                       return $content . $this->content($_REQUEST);
+               } catch (HTTPException $e) {
+                       return (new ModuleHTTPException())->content($e);
+               }
        }
 
        /*
index 23feec2b73a4c3b128e1a40d157e7c9a013a42f8..6c4ae51385410f49c73178ba493215f10385c4cd 100644 (file)
@@ -2,59 +2,20 @@
 
 namespace Friendica\Capabilities;
 
+use Friendica\Network\HTTPException;
+
 /**
  * This interface provides the capability to handle requests from clients and returns the desired outcome
  */
 interface ICanHandleRequests
 {
        /**
-        * Module GET method to display raw content from technical endpoints
+        * @param array $post    The $_POST content (in case of POST)
+        * @param array $request The $_REQUEST content (in case of GET, POST)
         *
-        * Extend this method if the module is supposed to return communication data,
-        * e.g. from protocol implementations.
-        */
-       public function rawContent();
-
-       /**
-        * Module GET method to display any content
+        * @return string Returns the content of the module as string
         *
-        * 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.
+        * @throws HTTPException\InternalServerErrorException
         */
-       public function content(): string;
-
-       /**
-        * Module DELETE method to process submitted data
-        *
-        * Extend this method if the module is supposed to process DELETE requests.
-        * Doesn't display any content
-        */
-       public function delete();
-
-       /**
-        * Module PATCH method to process submitted data
-        *
-        * Extend this method if the module is supposed to process PATCH requests.
-        * Doesn't display any content
-        */
-       public function patch();
-
-       /**
-        * 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 function post();
-
-       /**
-        * Module PUT method to process submitted data
-        *
-        * Extend this method if the module is supposed to process PUT requests.
-        * Doesn't display any content
-        */
-       public function put();
-
-       public function getClassName(): string;
+       public function run(array $post = [], array $request = []): string;
 }
index d307d84ac82995cd296f929e8707d496abcd2dbf..aae7db50a243052e1410aaa7cfaeae5e58b7b45d 100644 (file)
@@ -22,6 +22,8 @@
 namespace Friendica;
 
 use Friendica\Core\L10n;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 /**
  * This mock module enable class encapsulation of legacy global function modules.
@@ -39,9 +41,9 @@ class LegacyModule extends BaseModule
         */
        private $moduleName = '';
 
-       public function __construct(L10n $l10n, string $file_path = '', array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, array $server, string $file_path = '', array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->setModuleFile($file_path);
 
@@ -65,13 +67,15 @@ class LegacyModule extends BaseModule
                require_once $file_path;
        }
 
-       public function content(): string
+       public function content(array $request = []): string
        {
                return $this->runModuleFunction('content');
        }
 
-       public function post()
+       public function post(array $request = [], array $post = [])
        {
+               parent::post($post);
+
                $this->runModuleFunction('post');
        }
 
index 8de9e80afb874b6321d65b1a43569c1d7427733c..9a96ad68fb70b6bcdb735479f53dae4b136d985e 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\BaseModule;
  */
 class AccountManagementControlDocument extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $output = [
                        'version' => 1,
index 81b2c2391c263ed1f5b01dd9aa99cb27c3888725..5e37e614e0700fecad65547a8c69b20449de9e2e 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Network\HTTPException\NotFoundException;
  */
 class Acctlink extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $addr = trim($_GET['addr'] ?? '');
                if (!$addr) {
index d25e4693c9fd1c39d36be623d30a09b5bb3dceb7..5dd3a274a200e9696294ec9de3e04eb7e5ebbd7d 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Protocol\ActivityPub;
  */
 class Followers extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (empty($this->parameters['nickname'])) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
index 3b45cf09a608f87514f27bb7e8e5cfcf7ef00cbf..7a17edd1d7b2271e4c66154453e4ba34e4b04741 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Protocol\ActivityPub;
  */
 class Following extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (empty($this->parameters['nickname'])) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
index 149e51106959e24526f0f0bdb37e5db50de09982..19a695fc701a3a0676c7a853fba87017b796e828 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Util\Network;
  */
 class Inbox extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $postdata = Network::postdata();
 
index 5798c5685da7b93940d999218c06f847e016c612..a2c553746a72a77b375633e9efb8d28ec40c8465 100644 (file)
@@ -41,7 +41,7 @@ use Friendica\Util\Strings;
  */
 class Objects extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (empty($this->parameters['guid'])) {
                        throw new HTTPException\BadRequestException();
index c459a55e30e50622550a9afe2d7102d900520130..7cfadff949da0e69f686d46c447ef677e3593730 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Util\HTTPSignature;
  */
 class Outbox extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (empty($this->parameters['nickname'])) {
                        throw new \Friendica\Network\HTTPException\NotFoundException();
index bab52fb0de5edc3a49fdd259dd162e7cc2cdee7b..90abc54b57ee56298448b59a8a09713af2106ed3 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Util\Strings;
 
 class Details extends BaseAdmin
 {
-       public function post()
+       public function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -52,7 +52,7 @@ class Details extends BaseAdmin
                DI::baseUrl()->redirect($redirect);
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 6330ee2cfa5f738b9da27efc7306b6ff3d11ebe2..aa615943134e0870a805993e4bf5c9d3a51c2292 100644 (file)
@@ -28,7 +28,7 @@ use Friendica\Module\BaseAdmin;
 
 class Index extends BaseAdmin
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index a0a5c282f81aec06ec06a2d068897d4a1651a18d..1263b7c3f8473240663ec4eb04b6f5feffcd5d9c 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Util\Network;
 
 class Contact extends BaseAdmin
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -76,7 +76,7 @@ class Contact extends BaseAdmin
                DI::baseUrl()->redirect('admin/blocklist/contact');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 47c9016d90a6bdafb6adcb353bdeac50a31484a7..b7397d22b1cd256d714d556f7935619ad4548e2d 100644 (file)
@@ -32,7 +32,7 @@ use GuzzleHttp\Psr7\Uri;
 
 class Add extends BaseAdmin
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -66,7 +66,7 @@ class Add extends BaseAdmin
                DI::baseUrl()->redirect('admin/blocklist/server');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index ebd39d36a856453863f2b00ea1100e1035b104e2..3be131fac307c47b56b63dff181a16f80d6c2209 100644 (file)
@@ -27,7 +27,7 @@ use Friendica\Module\BaseAdmin;
 
 class Index extends BaseAdmin
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -56,7 +56,7 @@ class Index extends BaseAdmin
                DI::baseUrl()->redirect('admin/blocklist/server');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 6ef8d804aed80c6d9dee05c10c30c10b11fc7711..dac953dc88d46828fcf352c7a1aa57ec21f4f461 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Module\BaseAdmin;
 
 class DBSync extends BaseAdmin
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index d2c8e2d83af607e0717f9b3858233935473b95db..f5fea300fc80c8cb901b30bf2c001744cccd09f6 100644 (file)
@@ -28,7 +28,7 @@ use Friendica\Module\BaseAdmin;
 
 class Features extends BaseAdmin
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -60,7 +60,7 @@ class Features extends BaseAdmin
                DI::baseUrl()->redirect('admin/features');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 65d0453d933f67e78113408bf2b66ceda3ec7496..d0b906d02b7255d078a9aa5314c94af9eff6e746 100644 (file)
@@ -28,7 +28,7 @@ use Friendica\Module\BaseAdmin;
 
 class Federation extends BaseAdmin
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 91bb71932e817753cf49c760804cd1db8a273580..4ae0563e56fb6c0d4984241beea1e6205cfbe416 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\Util\Strings;
 
 class Delete extends BaseAdmin
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -55,7 +55,7 @@ class Delete extends BaseAdmin
                DI::baseUrl()->redirect('admin/item/delete');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index c1edabf60866dde385587ecddafc820dc023a547..2a60330291b8e265268bd7281470dfb95cc37aa7 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\Module\BaseAdmin;
 class Source extends BaseAdmin
 
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index aaf603f82502d26ae33396caa905d484768f8170..6f09b2957bed5dc15612bdd6d4e94e380cc145e0 100644 (file)
@@ -29,7 +29,7 @@ use Psr\Log\LogLevel;
 
 class Settings extends BaseAdmin
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -56,7 +56,7 @@ class Settings extends BaseAdmin
                DI::baseUrl()->redirect('admin/logs');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 3e312204b03909c14ca5a74b6cc0853212c5b33a..92055ec294410e12705e1459544a4f797d67e853 100644 (file)
@@ -31,7 +31,7 @@ class View extends BaseAdmin
 {
        const LIMIT = 500;
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index e6cad66c76c911aa5cfbdee712b5f27e8fd808b1..2932a8d658ea70a4b0e868b1c6b60d416d4207b8 100644 (file)
@@ -25,7 +25,7 @@ use Friendica\Module\BaseAdmin;
 
 class PhpInfo extends BaseAdmin
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAdminAccess();
 
index f43dfdc095e1cdbbdb017f1e73caa2d4943aef58..6fe4facefdca39248a66399ebd321cb2620777e4 100644 (file)
@@ -38,7 +38,7 @@ use Friendica\Util\DateTimeFormat;
  */
 class Queue extends BaseAdmin
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 27623880aeb6f6035d65680d43346df262e036cf..71f042f8d7ebf99047011e63666700de3a6dc0dc 100644 (file)
@@ -43,7 +43,7 @@ require_once __DIR__ . '/../../../boot.php';
 
 class Site extends BaseAdmin
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -384,7 +384,7 @@ class Site extends BaseAdmin
                DI::baseUrl()->redirect('admin/site' . $active_panel);
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 68d7d065d0c945eca4e0650b53d245b494edb35e..796f88bb32b4af972f7b0c64081d9309f6935bf1 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Util\Strings;
 
 class Storage extends BaseAdmin
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -91,7 +91,7 @@ class Storage extends BaseAdmin
                DI::baseUrl()->redirect('admin/storage');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 5b2efca1e0e5cdac6972055cae0f97d4546f02cc..c919524b1ebe50849823ea7738854c60589053b8 100644 (file)
@@ -37,7 +37,7 @@ use Friendica\Util\DateTimeFormat;
 
 class Summary extends BaseAdmin
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index b7161d1b96432f79d3579ea943357ef29ad668cb..7d64ce6370498d28cc7e25ec3e186ad097a71929 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Util\Strings;
 
 class Details extends BaseAdmin
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 0d2a2dc047f30a506cb4e9f62323ec049e3e6ff4..17a573a1d624b31938ef6b730960fabf15f91ba7 100644 (file)
@@ -25,24 +25,23 @@ use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Module\BaseAdmin;
+use Friendica\Util\Profiler;
 use Friendica\Util\Strings;
+use Psr\Log\LoggerInterface;
 
 class Embed extends BaseAdmin
 {
        /** @var App */
        protected $app;
-       /** @var App\BaseURL */
-       protected $baseUrl;
        /** @var App\Mode */
        protected $mode;
 
-       public function __construct(App $app, App\BaseURL $baseUrl, App\Mode $mode, L10n $l10n, array $parameters = [])
+       public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, App\Mode $mode, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
-               $this->app     = $app;
-               $this->baseUrl = $baseUrl;
-               $this->mode    = $mode;
+               $this->app  = $app;
+               $this->mode = $mode;
 
                $theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
                if (is_file("view/theme/$theme/config.php")) {
@@ -50,7 +49,7 @@ class Embed extends BaseAdmin
                }
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -70,7 +69,7 @@ class Embed extends BaseAdmin
                $this->baseUrl->redirect('admin/themes/' . $theme . '/embed?mode=minimal');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index ad4dfef94e3fccd3300830edaefbb912022e4fa5..0b458a90954b1208a9c308e41629f3236fef933f 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\Util\Strings;
 
 class Index extends BaseAdmin
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 0e019cc329c3333eb85863a45ff277336716ded9..c8fc6703c4d527fc0c9b6c03daa34e7b3d874cda 100644 (file)
 
 namespace Friendica\Module\Admin;
 
+use Friendica\App;
 use Friendica\App\BaseURL;
 use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Module\BaseAdmin;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 class Tos extends BaseAdmin
 {
@@ -33,19 +36,16 @@ class Tos extends BaseAdmin
        protected $tos;
        /** @var IManageConfigValues */
        protected $config;
-       /** @var BaseURL */
-       protected $baseUrl;
 
-       public function __construct(\Friendica\Module\Tos $tos, IManageConfigValues $config, BaseURL $baseUrl, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, \Friendica\Module\Tos $tos, IManageConfigValues $config, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->tos     = $tos;
                $this->config  = $config;
-               $this->baseUrl = $baseUrl;
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -66,7 +66,7 @@ class Tos extends BaseAdmin
                $this->baseUrl->redirect('admin/tos');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 6bcd22be4e1a1f82a8bf19eacbd6a8b73b53b134..fa8847d0ffc61d0704a38c133bca3193377a0f69 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Module\Admin\BaseUsers;
 
 class Active extends BaseUsers
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -60,7 +60,7 @@ class Active extends BaseUsers
                DI::baseUrl()->redirect(DI::args()->getQueryString());
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index a24c95df0b4bb7d37b9d4566ce9b787bcb17b1e0..8a8c105fa8b6ae07e5ede5c39a51afebe7d2b505 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Util\Temporal;
 
 class Blocked extends BaseUsers
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -61,7 +61,7 @@ class Blocked extends BaseUsers
                DI::baseUrl()->redirect('admin/users/blocked');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 71ab5b4cb9197f933be16bda8874c6920a76fb68..644b9343427fbfc4640d1606d669ad1ec3eb6efa 100644 (file)
@@ -28,7 +28,7 @@ use Friendica\Module\Admin\BaseUsers;
 
 class Create extends BaseUsers
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -51,7 +51,7 @@ class Create extends BaseUsers
                DI::baseUrl()->redirect('admin/users/create');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 6357b2396330a123ea3b51e52b11fcb92d1ce78c..4ebe153b874b3d7f12a1f706106c4d0dc518ae4e 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Util\Temporal;
 
 class Deleted extends BaseUsers
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -44,7 +44,7 @@ class Deleted extends BaseUsers
                DI::baseUrl()->redirect('admin/users/deleted');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index eb7b57c25c8fc9906171d40ac5ff313dc7414330..d0f29ee398a286e370c6e4290a489e78f5edc7d4 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Module\Admin\BaseUsers;
 
 class Index extends BaseUsers
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -67,7 +67,7 @@ class Index extends BaseUsers
                DI::baseUrl()->redirect(DI::args()->getQueryString());
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 801c159742307f93ee1c67599c9374d5194d2ea6..2917bc260739dcbec48a7011ee6a33d75bd39c88 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Util\Temporal;
 
 class Pending extends BaseUsers
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAdminAccess();
 
@@ -58,7 +58,7 @@ class Pending extends BaseUsers
                DI::baseUrl()->redirect('admin/users/pending');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 1b2b95d06add6339b13a1a71e62b3c29e7ad841c..c65d32d0e70839849f10340a34be1dbdeb3c5390 100644 (file)
@@ -40,7 +40,7 @@ use Friendica\Module\BaseApi;
  */
 class Activity extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 600d5fe1710d36a4650951006f384f2cce5da5db..6e1f3675fc1399b1a828641ff6d65c9b36a08955 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Module\BaseApi;
  */
 class Setseen extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index b6cfdd098206f8a006e96e331cade05b1694bec1..177e26f52bab8dd0c637d99fd7e40d4b8bc36997 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Module\BaseApi;
  */
 class Index extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index d78ea658e25e9028b3bd4be81c057b5b1693483d..9583c003d7601cdcb1559fdc95fe69cbc41f44da 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Network\HTTPException\BadRequestException;
  */
 class Delete extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index cc0428ae1e466f98f0736a94966b54fb2c1ae279..53229b98e73a99b7b5059c6db357e571bc11d976 100644 (file)
@@ -32,17 +32,17 @@ require_once __DIR__ . '/../../../../include/api.php';
  */
 class Index extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);             
        }
 
-       public function delete()
+       protected function delete()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
        }
 
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                echo api_call(DI::args()->getCommand(), $this->parameters['extension'] ?? 'json');
                exit();
index 9d316d94dad2cc44d7c19433df4d711f8a133a83..76bce7de27041af02138d8126d34cf526156dac7 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Object\Api\Friendica\Notification as ApiNotification;
  */
 class Notification extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index ab749b4e8740ce54eaca6da16cd8da6a4f7f22af..7da819a7a2748f29a31b1000af54030e5091ae58 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
  */
 class Delete extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 0a403270d1585d80316fd3373047403df75bca21..a8bb5d45e9ebce4115d18447892215b208b22654 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
  */
 class Delete extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 9fc89dbf6d2defe1c4d1858ed853af003bcb0fe5..d4d601790972ce8630fe57467b7fc911d67e104f 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
  */
 class Update extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 8f60c0f84b699815a1deebccd2144f0eeed38639..27a19f48e5412e9e0a5e9b5bf66644baa338bedd 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Network\HTTPException;
  */
 class Show extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 6e661d2d72985c4dca66a90cec73a3e3bedd3bdd..a3556fcdd9fc7705aea1a7cd75366c3d72fc237a 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\Register;
  */
 class Config extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $config = [
                        'site' => [
index c9c7b98fd1f6f4509a9bd57bf925ce0090d58b5e..67f23628c14f5c99f29d03019a9d7b8aed2453cc 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\DI;
  */
 class Version extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                DI::apiResponse()->exit('version', ['version' => '0.9.7'], $this->parameters['extension'] ?? null);
        }
index 78f18c3e60b3b19d937f284502121631280928e1..e2f05183e6a93cdeb51dd5a1a9ceaaa7abf250cb 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\DI;
  */
 class Test extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (!empty($this->parameters['extension']) && ($this->parameters['extension'] == 'xml')) {
                        $ok = 'true';
index 552889661b2ee9d5bedf10d3cdd42d13beb36721..043d94b6da40b8a7f91ef692a5e6be9782f6579d 100644 (file)
@@ -35,7 +35,7 @@ class Accounts extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $uid = self::getCurrentUserID();
 
index b2ae98bd56dc290929be4761b70ab99cfa3fef9d..a4e0bb88b7a14db7f6517ec734466a249200b775 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
  */
 class Block extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
index fe92696a08d8a7fa810e220d758e131504cd2652..c476d1090d6bdd2021cad9b53b4b3f54451f1425 100644 (file)
@@ -32,7 +32,7 @@ class FeaturedTags extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
 
index 2076d3307526cdc9476281eaadcc54e632a4ef9f..443ac25402dc89a6e90fee5cc149f177088bdcb0 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Follow extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
index 4c1a6429c5dcaccc5c1a470413243d9f700b65fe..08c56b3d440b3308d5bac7a0bfc5a7aaca3b6ea0 100644 (file)
@@ -34,7 +34,7 @@ class Followers extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 4b67c9700878fd7aa5f3a70352b58e694c197cd5..ded1e6a4b6a7df5235ab81866284a63add223025 100644 (file)
@@ -34,7 +34,7 @@ class Following extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 88379440abf2c328f2f49130a54127076ecca105..1edef9d81ee544d2ba8529222b257f38e7b5a7b3 100644 (file)
@@ -32,7 +32,7 @@ class IdentityProofs extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
 
index f34b961b6394efe704b77ba340276606e262a00b..7a77902e7ac634fd61492ea9d47ebbad2e09457e 100644 (file)
@@ -35,7 +35,7 @@ class Lists extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 1c711db750dc48a6fa0c8fcc690f6bbea853f5f4..824277348f8d63c5fe94dc72796ee20a1a352e76 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Mute extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
index fe4611754d98fd9562d56337a311805fd24ea7d9..cb0c181350f4bf96f1033eaff5262912579ec9e9 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
  */
 class Note extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 451b7b49ec2c8dbc7203de17a83a6f7c40840ae0..c3c8864468455bd46fb299ff85bdc184501ecdd5 100644 (file)
@@ -34,7 +34,7 @@ class Relationships extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index fb3aafaec24d34e31889ae3840143b2fa08606a8..b7b963e11f58cb8d9c9a543989aa0f0b20139e7a 100644 (file)
@@ -37,7 +37,7 @@ class Search extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 5bf7b49346807c1f8e9be0f30fd3a638e8b6a2d2..9027c68a4f8d739df3f3c6b144e50b2262ddec90 100644 (file)
@@ -39,7 +39,7 @@ class Statuses extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $uid = self::getCurrentUserID();
 
index ae2414b8acc55a248f04e9d01189e723d24df943..23d78e739b66d99d0d93f1021b0e35ae1fce38a8 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Unblock extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
index a15c946bb60525bee7d1e29b75ab054ca74d9284..81f919a6949b0ba94402db5d4e8d08dac7060c05 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Unfollow extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
index d1410f78246ee21c3770438cb3f32b2137f1fde8..c9673b98c357722ccf23c12f375cd1e3ebe1a886 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Unmute extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
index 2c55bff43ee2f7122c85db6993daffd0cd1b997f..1a390d4a1fae00ff04ac15899ec9d7b7bd02539c 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Util\HTTPInputData;
  */
 class UpdateCredentials extends BaseApi
 {
-       public function patch()
+       protected function patch()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 0cce460375121ea325a1a2cfc31b62d88daeb6e9..472ca7f5656e502f6f7350088b6cd73324789c7a 100644 (file)
@@ -35,7 +35,7 @@ class VerifyCredentials extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index b8d231df6a7fbea4cda7ea9dc849ad33168f4d6e..46b1e85e05f0852049ae888ad0c1ea41d361f44d 100644 (file)
@@ -32,7 +32,7 @@ class Announcements extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
 
index a00bd40857ee9699e648e53b03c63d2353ae4bdd..7b0b103c4c4e4cc414163fd4d4ccdd3cc082ca53 100644 (file)
@@ -35,7 +35,7 @@ class Apps extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                $request = self::getRequest([
                        'client_name'   => '',
index e9720da0f8d143b63082f7966b3d4fa1332788be..89e2fed086a8c5c83ac2474904e787646103ff13 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Module\BaseApi;
  */
 class VerifyCredentials extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $application = self::getCurrentApplication();
index 1f8b7ae6abd52db188eda7691e501d87c6db51dd..fe08f875dd2403d760457d74d63dfdcdbf3decc6 100644 (file)
@@ -34,7 +34,7 @@ class Blocks extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 7b51e4316c8e632faed0388221f4805756007d09..e5fcaeeaf50eb9709444c5ba9de7f5880fa1df5d 100644 (file)
@@ -36,7 +36,7 @@ class Bookmarks extends BaseApi
        /**
         * @throws HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index a3f6a26a281d1a258851c52556fbc39465678ad7..fc32c76ccc088bd18b050d98094e235ef07e1016 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Conversations extends BaseApi
 {
-       public function delete()
+       protected function delete()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -49,7 +49,7 @@ class Conversations extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 1eadc671c193ec20d47283749606739e580a61fa..a70cdfb00f3279eeef82b50159a04ffb28ff70d1 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Read extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 1fedf534825a6828cf433c76743c009c0150cf66..b82a9f7d693aea255e6e1d3f6b76a7e2578bc75d 100644 (file)
@@ -37,7 +37,7 @@ class CustomEmojis extends BaseApi
         * @throws \ImagickException
         * @see https://docs.joinmastodon.org/methods/accounts/follow_requests#pending-follows
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $emojis = DI::mstdnEmoji()->createCollectionFromSmilies(Smilies::getList());
 
index e48a709596efe5c2e9e261c65cdaf7b9b4f2e660..8ee6ac036085b20606e7c2ab35761738e3231bd3 100644 (file)
@@ -39,7 +39,7 @@ class Directory extends BaseApi
         * @throws \ImagickException
         * @see https://docs.joinmastodon.org/methods/instance/directory/
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $request = self::getRequest([
                        'offset' => 0,        // How many accounts to skip before returning results. Default 0.
index b9a5bc2cdbef98a95fc4712f8906617ef469e0a8..6c1097bc21608bf4e6fe0eb8a7dc491fded56b0f 100644 (file)
@@ -32,7 +32,7 @@ class Endorsements extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                System::jsonExit([]);
        }
index 48aa452f24cfe185c25c54539adc3652d006bbea..3d3e6aad1ebac16bf5c98e62692409f332691042 100644 (file)
@@ -37,7 +37,7 @@ class Favourited extends BaseApi
        /**
         * @throws HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 5bf50db1ab3578051b5ff0d1bef6aea3537ab9f5..38fc27ebc00dd2f1aeb5a1563e42b64caa59e71e 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Filters extends BaseApi
 {
-       public function post()
+       public function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
@@ -41,7 +41,7 @@ class Filters extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
 
index af4ac5771f8f3db4d889894dfbd553754b98a303..dbdab7e51b40af0035487f89c1212d446467835e 100644 (file)
@@ -42,7 +42,7 @@ class FollowRequests extends BaseApi
         * @see https://docs.joinmastodon.org/methods/accounts/follow_requests#accept-follow
         * @see https://docs.joinmastodon.org/methods/accounts/follow_requests#reject-follow
         */
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_FOLLOW);
                $uid = self::getCurrentUserID();
@@ -82,7 +82,7 @@ class FollowRequests extends BaseApi
         * @throws \ImagickException
         * @see https://docs.joinmastodon.org/methods/accounts/follow_requests/
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index b7dc7d700d002ca82a7fbd7427dba91a506fe074..ef89de3159e96d0b8986c1f5348b89066cc7c100 100644 (file)
@@ -33,7 +33,7 @@ class Instance extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                System::jsonExit(InstanceEntity::get());
        }
index b1fdd062bd2e9eb0187b3241015b80d19eea7a97..01b7045b2199dda91524806e80de8e536a8e858e 100644 (file)
@@ -36,7 +36,7 @@ class Peers extends BaseApi
        /**
         * @throws HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $return = [];
 
index 3063bf9ead63bab14f82ba9f08139c8be2d753b1..9154c4d6bf2ad0936d755707c8711b59550599d2 100644 (file)
@@ -36,7 +36,7 @@ class Rules extends BaseApi
        /**
         * @throws HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $rules = [];
                $id    = 0;
index e7a66f04db8559a80caab845a4b2bedfb03de375..ec9ad86a3424eae3eb49170e2c22894219302b40 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Model\Group;
  */
 class Lists extends BaseApi
 {
-       public function delete()
+       protected function delete()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -51,7 +51,7 @@ class Lists extends BaseApi
                System::jsonExit([]);
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -91,7 +91,7 @@ class Lists extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index feb670b271182644400a5353212e7744df9ca73a..66d6f068ec848e61e1b9451f8f10b3b557fb996d 100644 (file)
@@ -35,12 +35,12 @@ use Friendica\Module\BaseApi;
  */
 class Accounts extends BaseApi
 {
-       public function delete()
+       protected function delete()
        {
                DI::apiResponse()->unsupported(Router::DELETE);
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                DI::apiResponse()->unsupported(Router::POST);
        }
@@ -48,7 +48,7 @@ class Accounts extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 6a01a30cfab6531496131cc43838e974789fa094..5cd38925e46c6e14bd46cff4e40074e1ff653a19 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Markers extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
@@ -41,7 +41,7 @@ class Markers extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
 
index dc31bdec683a22a3e874714cf1ab5c3799ee98c4..65663882d455f681ea33adde0ef361204d171e76 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
  */
 class Media extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -82,7 +82,7 @@ class Media extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 191a2d607c23984e44a35308d7b9b3ec4ea0f186..515e04848cee63418e1978a5f35af19a6ac3ddc6 100644 (file)
@@ -34,7 +34,7 @@ class Mutes extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 274a8578668f6670f9e4ad709cdfcdfc1254255e..664c996c9702ecad02656a81ecbfe1b0fba8d8d4 100644 (file)
@@ -40,7 +40,7 @@ class Notifications extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 4249791579926ee10d82deb89ec7c9f13b0c34b4..d910fe07dfed1647b17dcfe793e0725239c4eb6b 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Module\BaseApi;
  */
 class Clear extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index b978e46eeefd775f696399fd4290b968d5f48a88..98861a2753fcd14333ebf273121b24f590e37792 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Network\HTTPException\ForbiddenException;
  */
 class Dismiss extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 6d846c35bc8cbc2cd16cd30d734a37683181a6ac..14b5efe6816f6c7ca688819f50857cc112c5645c 100644 (file)
@@ -34,7 +34,7 @@ class Preferences extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index c9b92246a82bc23c3078632d6941078a09623c76..f39cfcf2713ae657d4cace970a9849ddc67d4d49 100644 (file)
@@ -32,7 +32,7 @@ class Proofs extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                System::jsonError(404, ['error' => 'Record not found']);
        }
index e45c943f52bf14c0e0802337890947524ce4a210..91e79b82db246047bb962d3d3039d9ee7463379e 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Object\Api\Mastodon\Notification;
  */
 class PushSubscription extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_PUSH);
                $uid         = self::getCurrentUserID();
@@ -99,7 +99,7 @@ class PushSubscription extends BaseApi
                return DI::mstdnSubscription()->createForApplicationIdAndUserId($application['id'], $uid)->toArray();
        }
 
-       public function delete()
+       protected function delete()
        {
                self::checkAllowedScope(self::SCOPE_PUSH);
                $uid         = self::getCurrentUserID();
@@ -112,7 +112,7 @@ class PushSubscription extends BaseApi
                System::jsonExit([]);
        }
 
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_PUSH);
                $uid         = self::getCurrentUserID();
index bfb2cff455eb82afc2f7a28454504d1ff729b469..605aaeb6d6a06229978b550a919325acb33d95e3 100644 (file)
@@ -42,7 +42,7 @@ class ScheduledStatuses extends BaseApi
                DI::apiResponse()->unsupported(Router::PUT);
        }
 
-       public function delete()
+       protected function delete()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -63,7 +63,7 @@ class ScheduledStatuses extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 6753b090983989ab311e7ea93634c4809a7d95b1..026d71f04bbe19bf15e6414aa19974bf5b0f274d 100644 (file)
@@ -40,7 +40,7 @@ class Search extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 50c35f34772dd4f9427d04e8ef33f278867e89cf..21bb972850cd956e71006da6329bbd89592a42d8 100644 (file)
@@ -41,7 +41,7 @@ use Friendica\Util\Images;
  */
 class Statuses extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
@@ -207,7 +207,7 @@ class Statuses extends BaseApi
                DI::mstdnError()->InternalError();
        }
 
-       public function delete()
+       protected function delete()
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
@@ -231,7 +231,7 @@ class Statuses extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $uid = self::getCurrentUserID();
 
index de0ef641d34ce33bcc89ba812e9b43488079851a..0ff561189efefc2f805d5f39c3ff175e47c13a11 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Module\BaseApi;
  */
 class Bookmark extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index d3c1801a29ed9a844f6a85304d679b871d87aed5..eeed4bb0a6ec8ab89247233076024d0a41434ba4 100644 (file)
@@ -35,7 +35,7 @@ class Card extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $uid = self::getCurrentUserID();
 
index 03782ef1ce4d44df115b3f262884d35abb5c45c8..674be5f22d071bd82dc89e5c99610abaf591da9f 100644 (file)
@@ -35,7 +35,7 @@ class Context extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $uid = self::getCurrentUserID();
 
index 8ec818a8ff84570fc1797d9dce14708faf16f8ce..fc070548b9e08ada84c1e44f8ef1b6d8e2b806c8 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Module\BaseApi;
  */
 class Favourite extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 37d9e7521a6951719195746632c0e2151c63a481..d29da2c99ea0b8213a0a8884bdd5ea1293af9335 100644 (file)
@@ -35,7 +35,7 @@ class FavouritedBy extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $uid = self::getCurrentUserID();
 
index 4a0e943f344d1a00f2ae9cbf233c470d03d84e6e..7b7a6705174cc78c7e2737b2b49259eb9eec5f5f 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
  */
 class Mute extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 7648d12a0b34d1affb54bb0513c9aabf484b2c39..9697d795b9c5be4e750aa65298b74e9447f78da6 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
  */
 class Pin extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index d10149616a638742dadfb92703b8b8718145aa67..64d30e66dd5948598827cc26a30f822e3c0e0e15 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Module\BaseApi;
  */
 class Reblog extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 52f1e2f67d1861d7e76802cb79126b654537debf..a3010e88263a5e142f07b8c7ff77b6b85ceb76ad 100644 (file)
@@ -35,7 +35,7 @@ class RebloggedBy extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $uid = self::getCurrentUserID();
 
index 9279fec60e38f2a022f4e19fa11b6edbba5ce7ab..3232e129818d4fdc966f2fea9886c1963b6bc5df 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Module\BaseApi;
  */
 class Unbookmark extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 7898647acc50caa2999b9b3d10d7ac230a3f72f2..7e5081656d50da378b952ac44fba8ce93aeb8b6e 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Module\BaseApi;
  */
 class Unfavourite extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 80b9c2c541f46ddebca3121b7483084453bd37ce..c380f05d0fe6db4e8a59c7ff3b7f1499d9730691 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
  */
 class Unmute extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 21f44b7cbb2f1cf4d9263d2979c96ef4abfc5aee..9af2fe28d2c7d1cd317b7b9a71a17dfb0c5e365e 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
  */
 class Unpin extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index 972a6aa1aff69957c9683bc6a3aa401936a478b9..27708acad2c01209fd03ae9504976c4d22cafef9 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Module\BaseApi;
  */
 class Unreblog extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
                $uid = self::getCurrentUserID();
index b80c239f630419da5337e2ac9ac3d853c40ef4dd..bda78becf15e2afc8ea39fdde66dd369a86a0a17 100644 (file)
@@ -34,7 +34,7 @@ class Suggestions extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index d50c97f47ea61a9251440f5c0ab9716550bdd1cf..ef2a9bb1a3b9f8a10dfd08d9ce7ba2ef65d008f6 100644 (file)
@@ -35,7 +35,7 @@ class Direct extends BaseApi
        /**
         * @throws HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index de21bb2a121cca151cc8f6f9d11e06e1d4e9131b..2727745f0337adc3366224f649c4eea00577615a 100644 (file)
@@ -36,7 +36,7 @@ class Home extends BaseApi
        /**
         * @throws HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index c9316fdf53b194ee57727ba891e765831d455cf2..1fe3f3b47f87e20b6dee73409cabf84e95877353 100644 (file)
@@ -36,7 +36,7 @@ class ListTimeline extends BaseApi
        /**
         * @throws HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 162236d1eaf87e6adbb29f610ae6375d68de2d2d..91894f5c6cd4c8517e8b6905141daee357a88133 100644 (file)
@@ -39,7 +39,7 @@ class PublicTimeline extends BaseApi
        /**
         * @throws HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $uid = self::getCurrentUserID();
 
index 3571dd73335103cc757aeaa673b95ef4be614899..701d656e43073d45fe90881474599924bda76ae9 100644 (file)
@@ -37,7 +37,7 @@ class Tag extends BaseApi
        /**
         * @throws HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index 3536e737cb6b13a27f245c191a1dffe0fa1ec47d..c9659f7d2456c91e51bfaf5f6b4e0f615aacfc7a 100644 (file)
@@ -34,7 +34,7 @@ class Trends extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $request = self::getRequest([
                        'limit' => 20, // Maximum number of results to return. Defaults to 10.
index f5f76afd57010daab1cf8a5d7b2c4e2137f4d5b0..9874b504a78484e89c23a51e0866f0689f2d0ad4 100644 (file)
@@ -33,7 +33,7 @@ class Unimplemented extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function delete()
+       protected function delete()
        {
                DI::apiResponse()->unsupported(Router::DELETE);
        }
@@ -41,7 +41,7 @@ class Unimplemented extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function patch()
+       protected function patch()
        {
                DI::apiResponse()->unsupported(Router::PATCH);
        }
@@ -49,7 +49,7 @@ class Unimplemented extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                DI::apiResponse()->unsupported(Router::POST);
        }
@@ -65,7 +65,7 @@ class Unimplemented extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                DI::apiResponse()->unsupported(Router::GET);
        }
index 9a275cecb989a77b2b98eb6821e3d08de4a6ff36..82cf2c3e660c0195b6b3d98d6946ad6cbbe6685c 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Util\DateTimeFormat;
  */
 class RateLimitStatus extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (!empty($this->parameters['extension']) && ($this->parameters['extension'] == 'xml')) {
                        $hash = [
index 9227815a00474387077bf221d052bb369d201b38..a0e5ab11e035f8930710b69a1d39881ccca1e749 100644 (file)
@@ -21,6 +21,7 @@
 
 namespace Friendica\Module\Api\Twitter;
 
+use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Database\DBA;
 use Friendica\DI;
@@ -29,16 +30,18 @@ use Friendica\Model\User;
 use Friendica\Module\BaseApi;
 use Friendica\Model\Contact;
 use Friendica\Network\HTTPException;
+use Friendica\Util\Profiler;
 use Friendica\Util\Strings;
+use Psr\Log\LoggerInterface;
 
 abstract class ContactEndpoint extends BaseApi
 {
        const DEFAULT_COUNT = 20;
        const MAX_COUNT = 200;
 
-       public function __construct(L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                self::checkAllowedScope(self::SCOPE_READ);
        }
index f529fc926bd193398edc14d62061727bbae5e6c1..5f203a052282f6084af8fce4d9102fea9a3281e4 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Ids extends ContactEndpoint
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = BaseApi::getCurrentUserID();
index 0bd3addd595764142af0ffd330b3ce10c4efb324..a812e38da6769bd97c4647f09a66d8ccc6c779c3 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Lists extends ContactEndpoint
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = BaseApi::getCurrentUserID();
index 0c25700ccfc891ef5519e829cad3e5c81db1bec2..62164840dcdce186facc50582f28fa8319a16607 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Ids extends ContactEndpoint
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = BaseApi::getCurrentUserID();
index 25bd32969a1d52a3abca580cccd033510f5317f6..57841c3c90ab856b83b621bce7c11550fc9fd5c6 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class Lists extends ContactEndpoint
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = BaseApi::getCurrentUserID();
index ac75316710e79a82383d36890c4d702fca06395c..3fd30e34ea93cceb9c9ed07166c51d005a65f091 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\BaseApi;
  */
 class SavedSearches extends BaseApi
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::checkAllowedScope(self::SCOPE_READ);
                $uid = self::getCurrentUserID();
index f414f7f8cb2525f241d307e8453c4a951191fb13..bb3b64aec518e39be9428c7956011c935ccb70f1 100644 (file)
 
 namespace Friendica\Module;
 
+use Friendica\App;
 use Friendica\App\BaseURL;
 use Friendica\BaseModule;
 use Friendica\Content\Nav;
 use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 /**
  * Shows the App menu
  */
 class Apps extends BaseModule
 {
-       public function __construct(L10n $l10n, IManageConfigValues $config, BaseURL $baseUrl, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, IManageConfigValues $config, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $privateaddons = $config->get('config', 'private_addons');
                if ($privateaddons === "1" && !local_user()) {
@@ -43,7 +46,7 @@ class Apps extends BaseModule
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $apps = Nav::getAppMenu();
 
index c35e6b9ba393405be0ac94393a1fbbb1483ae3d5..bd785881c3d067a9a36cdfb0a17bf2ae7b84740c 100644 (file)
@@ -34,7 +34,7 @@ class Attach extends BaseModule
        /**
         * Return to user an attached file given the id
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $a = DI::app();
                if (empty($this->parameters['item'])) {
index 83e3ca0b17e52150c548b31f214f36de59512673..91b9e85b689fb4fdf9f572364b54f75bac650113 100644 (file)
@@ -68,7 +68,7 @@ abstract class BaseAdmin extends BaseModule
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                self::checkAdminAccess(true);
 
index 03c8467a43fda3746141aeba973fc40d3e99f9af..03a28951e3f8e575a5635cc4572d7ad013f1c634 100644 (file)
@@ -53,7 +53,7 @@ class BaseApi extends BaseModule
         */
        protected static $request = [];
 
-       public function delete()
+       protected function delete()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
@@ -62,7 +62,7 @@ class BaseApi extends BaseModule
                }
        }
 
-       public function patch()
+       protected function patch()
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
@@ -71,7 +71,7 @@ class BaseApi extends BaseModule
                }
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                self::checkAllowedScope(self::SCOPE_WRITE);
 
index 0e39eb651df33cf6a6e36e66e04bddc26c826110..bea0147dd9c11c510dd6c709990f5708c818130b 100644 (file)
@@ -22,6 +22,7 @@
 namespace Friendica\Module;
 
 use Exception;
+use Friendica\App;
 use Friendica\App\Arguments;
 use Friendica\BaseModule;
 use Friendica\Content\Pager;
@@ -30,6 +31,8 @@ use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Navigation\Notifications\ValueObject\FormattedNotification;
 use Friendica\Network\HTTPException\ForbiddenException;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 /**
  * Base Module for each tab of the notification display
@@ -86,9 +89,9 @@ abstract class BaseNotifications extends BaseModule
         */
        abstract public function getNotifications();
 
-       public function __construct(Arguments $args, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                if (!local_user()) {
                        throw new ForbiddenException($this->t('Permission denied.'));
@@ -98,11 +101,9 @@ abstract class BaseNotifications extends BaseModule
 
                $this->firstItemNum = ($page * self::ITEMS_PER_PAGE) - self::ITEMS_PER_PAGE;
                $this->showAll      = ($_REQUEST['show'] ?? '') === 'all';
-
-               $this->args = $args;
        }
 
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                // If the last argument of the query is NOT json, return
                if ($this->args->get($this->args->getArgc() - 1) !== 'json') {
index 7afaa35d0aefeb97658e53e3ba3d3c60dc11af6c..d0a7d0b6c0a4e00062017e2630e4bbe7328a9cf8 100644 (file)
@@ -28,7 +28,7 @@ use Friendica\DI;
 
 class BaseSettings extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $a = DI::app();
 
index 5061254aa1e5e957eef433e6692cbd86f1cb35e4..b5306cca0cf3d662dd874d9b4c35f0a2b989cb6b 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Util\Strings;
  */
 class Bookmarklet extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $_GET['mode'] = 'minimal';
 
index 2db4af5e9cb2f01e75a3a7e68d56bf3c3b4f0f54..8d5e26a261ab9381aaba96f11cecc24dcc6053c3 100644 (file)
@@ -91,7 +91,7 @@ class Contact extends BaseModule
                DI::baseUrl()->redirect($redirectUrl);
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user()) {
                        return;
index 8d0a4e0f3f1255c575f6f62ebb94f0c36cc5d206..e34d6321b64694cf1f0467275f57dda1cc12e231 100644 (file)
@@ -21,6 +21,7 @@
 
 namespace Friendica\Module\Contact;
 
+use Friendica\App;
 use Friendica\App\Page;
 use Friendica\BaseModule;
 use Friendica\Content\Widget;
@@ -33,6 +34,7 @@ use Friendica\Model;
 use Friendica\Module\Contact;
 use Friendica\Network\HTTPException\BadRequestException;
 use Friendica\Network\HTTPException\ForbiddenException;
+use Friendica\Util\Profiler;
 use Friendica\Util\Strings;
 use Psr\Log\LoggerInterface;
 
@@ -43,25 +45,22 @@ class Advanced extends BaseModule
 {
        /** @var Database */
        protected $dba;
-       /** @var LoggerInterface */
-       protected $logger;
        /** @var Page */
        protected $page;
 
-       public function __construct(Database $dba, LoggerInterface $logger, Page $page, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, App\Page $page, LoggerInterface $logger, Profiler $profiler, Database $dba, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
-               $this->dba    = $dba;
-               $this->logger = $logger;
-               $this->page   = $page;
+               $this->dba  = $dba;
+               $this->page = $page;
 
                if (!Session::isAuthenticated()) {
                        throw new ForbiddenException($this->t('Permission denied.'));
                }
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                $cid = $this->parameters['id'];
 
@@ -110,7 +109,7 @@ class Advanced extends BaseModule
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $cid = $this->parameters['id'];
 
index bfe689c1e3997a3c1fac3710509c2287d4b17c30..4d74935387e7633dd4041172344f3da13bbd8c60 100644 (file)
@@ -14,7 +14,7 @@ use Friendica\Network\HTTPException;
 
 class Contacts extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $app = DI::app();
 
index 34560313d7d571ce0dc2b3f078f0206299603a42..adc503fa513116cf4ad51d9f4289764bae082889 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Util\Strings;
  */
 class Hovercard extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $contact_url = $_REQUEST['url'] ?? '';
 
index a3a498b6d1de8b5c1fea50bcd4f22c92826980bb..f2ff694e4858a4caa88df467ee28e11323f5b4bc 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Network\HTTPException\BadRequestException;
  */
 class Media extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $cid = $this->parameters['id'];
 
index 23ec95a435ff9f60c96f9d5dad117e9263f48481..718095c506f39fd2ce41bd5bf1c84844ce6bdbf0 100644 (file)
@@ -18,7 +18,7 @@ use Friendica\Util\XML;
 
 class Poke extends BaseModule
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user() || empty($this->parameters['id'])) {
                        return self::postReturn(false);
@@ -123,7 +123,7 @@ class Poke extends BaseModule
                return $success;
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
index 88177cc3b4efcec455dc165859d37943fb21d28b..edb3e6586d49428ff5ef1a47273d1a6111660ee9 100644 (file)
@@ -21,8 +21,7 @@
 
 namespace Friendica\Module\Contact;
 
-use Friendica\App\Arguments;
-use Friendica\App\BaseURL;
+use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Content\Nav;
 use Friendica\Core\L10n;
@@ -33,6 +32,8 @@ use Friendica\Model;
 use Friendica\Module\Contact;
 use Friendica\Module\Security\Login;
 use Friendica\Network\HTTPException;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 class Revoke extends BaseModule
 {
@@ -41,18 +42,12 @@ class Revoke extends BaseModule
        
        /** @var Database */
        protected $dba;
-       /** @var BaseURL */
-       protected $baseUrl;
-       /** @var Arguments */
-       protected $args;
-       
-       public function __construct(Database $dba, BaseURL $baseUrl, Arguments $args, L10n $l10n, array $parameters = [])
+
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Database $dba, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->dba     = $dba;
-               $this->baseUrl = $baseUrl;
-               $this->args    = $args;
 
                if (!local_user()) {
                        return;
@@ -78,7 +73,7 @@ class Revoke extends BaseModule
                }
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException();
@@ -98,7 +93,7 @@ class Revoke extends BaseModule
                $this->baseUrl->redirect('contact/' . $this->parameters['id']);
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        return Login::form($_SERVER['REQUEST_URI']);
index d954ef8f39b70e45ab67d53523bf221a4cc25107..0edd12c3034a18da706b834e38d3d8d59975f93a 100644 (file)
@@ -49,7 +49,7 @@ class Community extends BaseModule
        protected static $max_id;
        protected static $item_id;
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $this->parseRequest();
 
index 0f2d9cd6fc92f148488df9c3fad523e9b37cfcf1..ac04cf2aef746ad2a50f2b45cb175c81b21bdf47 100644 (file)
@@ -57,7 +57,7 @@ class Network extends BaseModule
        /** @var string */
        protected static $order;
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        return Login::form();
index fdd4f6974943f24c8c0daf591b981fca23440ed6..cdd16c7b45a8da2403579055c9a1a06353628010 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\DI;
  */
 class Credits extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                /* fill the page with credits */
                $credits_string = file_get_contents('CREDITS.txt');
index eda5da9361cc24eeb5648211e4f9f697a8f3dc84..de03992da380f52f27ecf49c7856d2b7d90a271d 100644 (file)
@@ -38,7 +38,7 @@ use Friendica\Network\HTTPException;
  */
 class Notify extends BaseModule
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                $postdata = Network::postdata();
 
index 0cf43f2a7ef202beb98abdc1126ea4083af72716..7cb9c292192bfcd94ef054d0d8fae55db8bf8b0b 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\Protocol\OStatus;
  */
 class Poll extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                header("Content-type: application/atom+xml");
                $last_update = $_GET['last_update'] ?? '';
index 7f5fa6274dc31f29a7e8ccb7cd8ce3efb7160599..c9c2526a9cbcde4101ac82f4b6c99d8ead758628 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Util\XML;
 
 class ActivityPubConversion extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                function visible_whitespace($s)
                {
index c50bd08d74c4492010e9d9de796312ec6c63beef..d449bd07c4152b91cdb4e3da027abe60dc9ecbb0 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Util\XML;
  */
 class Babel extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                function visible_whitespace($s)
                {
index 9368dd0268c05a0d870cbecadf85ace46b8833ab..d85a85819c9b0e5bc56ddcd6a815fd166ed0ee95 100644 (file)
 
 namespace Friendica\Module\Debug;
 
-use Friendica\App\BaseURL;
+use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Model;
 use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests;
 use Friendica\Protocol;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 /**
  * Tests a given feed of a contact
@@ -37,9 +39,9 @@ class Feed extends BaseModule
        /** @var ICanSendHttpRequests */
        protected $httpClient;
 
-       public function __construct(BaseURL $baseUrl, ICanSendHttpRequests $httpClient, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ICanSendHttpRequests $httpClient, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->httpClient = $httpClient;
 
@@ -49,7 +51,7 @@ class Feed extends BaseModule
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $result = [];
                if (!empty($_REQUEST['url'])) {
index 3759931145e16ee30423144576f1e421116c708c..1477b629d0b01af3075f053ae7fe0720c98e3047 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Network\HTTPException;
  */
 class ItemBody extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('Access denied.'));
index 6fb91380ae5bdd8e082cd11fd1173a0ea9095a91..97a645485081ad1508c21e4878033b3e721d3274 100644 (file)
@@ -31,7 +31,7 @@ class Localtime extends BaseModule
 {
        static $mod_localtime = '';
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                $time = ($_REQUEST['time'] ?? '') ?: 'now';
 
@@ -42,7 +42,7 @@ class Localtime extends BaseModule
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $time = ($_REQUEST['time'] ?? '') ?: 'now';
 
index fcb7dda2188ec4224106edb23d9ea85cb1dbdc0e..07f82eaacdd2b525ee7c72ca7f2bb067683d52db 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Network\Probe as NetworkProbe;
  */
 class Probe extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
index 4527d2fb22f2b8b88ef34dee661c48ca41979333..1f576e7f9a0c4f67c0d86cd7b5a1ffe4561209e0 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Network\Probe;
  */
 class WebFinger extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
index 2b36fc2a306600bc978647b1b2ce9ee2f3bc5cb1..b242f5faa37387557dd0692e3d6316084f351deb 100644 (file)
@@ -37,7 +37,7 @@ use Friendica\Util\Proxy;
  */
 class Delegation extends BaseModule
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user()) {
                        return;
@@ -112,7 +112,7 @@ class Delegation extends BaseModule
                // NOTREACHED
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
index e3d6f4616efd84e155139f619f5383038cbe6758..7a32dac6d35fbe1e248d675ac985e5ce125cd001 100644 (file)
@@ -38,7 +38,7 @@ use Friendica\Util\Strings;
  */
 class Fetch extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (empty($this->parameters['guid'])) {
                        throw new HTTPException\NotFoundException();
index ed4f8a5d25fad672b8ee42a1edd7f07d3eb489e3..60a9716f4e4bfd192d11476167d7ef3f017a38a4 100644 (file)
@@ -21,6 +21,7 @@
 
 namespace Friendica\Module\Diaspora;
 
+use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\L10n;
@@ -28,6 +29,7 @@ use Friendica\Model\User;
 use Friendica\Network\HTTPException;
 use Friendica\Protocol\Diaspora;
 use Friendica\Util\Network;
+use Friendica\Util\Profiler;
 use Psr\Log\LoggerInterface;
 
 /**
@@ -36,20 +38,17 @@ use Psr\Log\LoggerInterface;
  */
 class Receive extends BaseModule
 {
-       /** @var LoggerInterface */
-       protected $logger;
        /** @var IManageConfigValues */
        protected $config;
 
-       public function __construct(LoggerInterface $logger, IManageConfigValues $config, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, IManageConfigValues $config, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
-               
-               $this->logger = $logger;
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
+
                $this->config = $config;
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                $enabled = $this->config->get('system', 'diaspora_enabled', false);
                if (!$enabled) {
index a81780a28014f5b89af0ec3f5cb423e1d42c1a7d..e43d2726195592c63b141dfda808bed12eb7e5db 100644 (file)
@@ -38,7 +38,7 @@ use Friendica\Network\HTTPException;
  */
 class Directory extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $app = DI::app();
                $config = DI::config();
index 566cf648a2ad591f3f2552f73ba0cc87d66cb817..859b0621ebc5fa7d2ccd405afb1207042a8a4f97 100644 (file)
@@ -13,7 +13,7 @@ use Friendica\Util\Temporal;
 
 class Json extends \Friendica\BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException();
index 6470ab5c373b8c9e402e35c153dec0a4dac6d8e8..f4a671c055b1a2120e11e7da1578d624a282e5f4 100644 (file)
@@ -41,7 +41,7 @@ use Friendica\Protocol\Feed as ProtocolFeed;
  */
 class Feed extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $a = DI::app();
 
index e6749de020ee1d445ec1b1aa0b610912b7fd790a..68d265c5fe28a3303f1993e61dbf953e512d2409 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Util\XML;
  */
 class RemoveTag extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException();
index fd572a7beafe4b44ebd2281dda3fdbc5df66a773..26801d3e9254da55f4ef2eadf62cfa6d313498a6 100644 (file)
 
 namespace Friendica\Module\Filer;
 
-use Friendica\App\BaseURL;
+use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\Model;
 use Friendica\Network\HTTPException;
+use Friendica\Util\Profiler;
 use Friendica\Util\XML;
 use Psr\Log\LoggerInterface;
 
@@ -36,22 +37,17 @@ use Psr\Log\LoggerInterface;
  */
 class SaveTag extends BaseModule
 {
-       /** @var LoggerInterface */
-       protected $logger;
-       
-       public function __construct(LoggerInterface $logger, BaseURL $baseUrl, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
-               
-               $this->logger = $logger;
-               
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
+
                if (!local_user()) {
                        notice($this->t('You must be logged in to use this module'));
                        $baseUrl->redirect();
                }
        }
 
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $term = XML::unescape(trim($_GET['term'] ?? ''));
 
index 41f811698bed01514acb221da2ebbd789a754065..388c07a3794f4b6b4d4071427fc606ca534c6d8e 100644 (file)
@@ -10,8 +10,9 @@ use Friendica\Model\Contact;
  */
 class FollowConfirm extends BaseModule
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
+               parent::post($post);
                $uid = local_user();
                if (!$uid) {
                        notice(DI::l10n()->t('Permission denied.'));
index 940e6ff9ce661fcceac00bd018b85eaeaf2c39c4..79d5fd81391f21ae887c4d0401d661a30dac3da1 100644 (file)
@@ -21,7 +21,7 @@
 
 namespace Friendica\Module;
 
-use Friendica\App\BaseURL;
+use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Core\L10n;
 use Friendica\Core\Protocol;
@@ -31,16 +31,16 @@ use Friendica\Database\Database;
 use Friendica\Model\Contact as ContactModel;
 use Friendica\Network\HTTPException\ForbiddenException;
 use Friendica\Network\HTTPException\NotFoundException;
+use Friendica\Util\Profiler;
 use Friendica\Util\Strings;
 use Friendica\Worker\Delivery;
+use Psr\Log\LoggerInterface;
 
 /**
  * Suggest friends to a known contact
  */
 class FriendSuggest extends BaseModule
 {
-       /** @var BaseURL */
-       protected $baseUrl;
        /** @var Database */
        protected $dba;
        /** @var \Friendica\Contact\FriendSuggest\Repository\FriendSuggest */
@@ -48,21 +48,20 @@ class FriendSuggest extends BaseModule
        /** @var \Friendica\Contact\FriendSuggest\Factory\FriendSuggest */
        protected $friendSuggestFac;
 
-       public function __construct(BaseURL $baseUrl, Database $dba, \Friendica\Contact\FriendSuggest\Repository\FriendSuggest $friendSuggestRepo, \Friendica\Contact\FriendSuggest\Factory\FriendSuggest $friendSuggestFac, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler,Database $dba, \Friendica\Contact\FriendSuggest\Repository\FriendSuggest $friendSuggestRepo, \Friendica\Contact\FriendSuggest\Factory\FriendSuggest $friendSuggestFac, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                if (!local_user()) {
                        throw new ForbiddenException($this->t('Permission denied.'));
                }
 
-               $this->baseUrl           = $baseUrl;
                $this->dba               = $dba;
                $this->friendSuggestRepo = $friendSuggestRepo;
                $this->friendSuggestFac  = $friendSuggestFac;
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                $cid = intval($this->parameters['contact']);
 
@@ -100,7 +99,7 @@ class FriendSuggest extends BaseModule
                info($this->t('Friend suggestion sent.'));
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $cid = intval($this->parameters['contact']);
 
index b4de151e9783b410510aa67d26b53dfc5f53cf73..74d9309bdb280bcd2eb9cf301b75b270d7d6c0c6 100644 (file)
@@ -38,7 +38,7 @@ use Friendica\Protocol\ActivityPub;
  */
 class Friendica extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $config = DI::config();
 
@@ -110,7 +110,7 @@ class Friendica extends BaseModule
                ]);
        }
 
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (ActivityPub::isRequest()) {
                        try {
index 39eb896d402ed5f004a08630a00ec0b7e842ecae..883f09cb55a46746fcc43a2642734a58ba292731 100644 (file)
@@ -32,7 +32,7 @@ require_once 'boot.php';
 
 class Group extends BaseModule
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (DI::mode()->isAjax()) {
                        $this->ajaxPost();
@@ -140,7 +140,7 @@ class Group extends BaseModule
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $change = false;
 
index 110371ee9595851d67cbacbaf21ed131e745213f..12ea65f136fb2c16432100616575c83113f4cc73 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Network\HTTPException;
  */
 class HCard extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if ((local_user()) && ($this->parameters['action'] ?? '') === 'view') {
                        // A logged in user views a profile of a user
index 07aab537a869d3faf1994db31ae826d9cbae9007..bfe0e18f8012aa416c591ba01f820e8d94a16ae7 100644 (file)
@@ -27,7 +27,7 @@ use Friendica\Network\HTTPException;
 
 class MethodNotAllowed extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                throw new HTTPException\MethodNotAllowedException(DI::l10n()->t('Method Not Allowed.'));
        }
index 6af5e91ae61e050ca36086ab01bba8e962f7e83a..4971ed3cd0c41353704907c4c5dbc2228e472470 100644 (file)
@@ -27,8 +27,39 @@ use Friendica\Network\HTTPException;
 
 class PageNotFound extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                throw new HTTPException\NotFoundException(DI::l10n()->t('Page not found.'));
        }
+
+       public function run(array $post = [], array $request = []): string
+       {
+               /* The URL provided does not resolve to a valid module.
+                *
+                * On Dreamhost sites, quite often things go wrong for no apparent reason and they send us to '/internal_error.html'.
+                * We don't like doing this, but as it occasionally accounts for 10-20% or more of all site traffic -
+                * we are going to trap this and redirect back to the requested page. As long as you don't have a critical error on your page
+                * this will often succeed and eventually do the right thing.
+                *
+                * Otherwise we are going to emit a 404 not found.
+                */
+               $queryString = $this->server['QUERY_STRING'];
+               // Stupid browser tried to pre-fetch our Javascript img template. Don't log the event or return anything - just quietly exit.
+               if (!empty($queryString) && preg_match('/{[0-9]}/', $queryString) !== 0) {
+                       exit();
+               }
+
+               if (!empty($queryString) && ($queryString === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
+                       $this->logger->info('index.php: dreamhost_error_hack invoked.', ['Original URI' => $this->server['REQUEST_URI']]);
+                       $this->baseUrl->redirect($this->server['REQUEST_URI']);
+               }
+
+               $this->logger->debug('index.php: page not found.', [
+                       'request_uri' => $this->server['REQUEST_URI'],
+                       'address'     => $this->server['REMOTE_ADDR'],
+                       'query'       => $this->server['QUERY_STRING']
+               ]);
+
+               return parent::run($post, $request); // TODO: Change the autogenerated stub
+       }
 }
index 8910d9cce473c3b78680534f31b4e092628ab7d6..1ac73de531fb8fe39f78dfe1305912007e8b0f3e 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Util\Strings;
  */
 class Hashtag extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $result = [];
 
index d0b61c2211c9f9ddee5a87ad6b04a3e94ccec8f2..f4083c310badd7ea9060caf01bc632e2d3e6e0ac 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Network\HTTPException;
  */
 class Help extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                Nav::setSelected('help');
 
index f4e6b973398e1a23c1e72654a61197460b119e20..ca0ce0b7258dc5bd1c8e0ce1e5cd9b21f60841d1 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Module\Security\Login;
  */
 class Home extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $app = DI::app();
                $config = DI::config();
index 4385ba85175dcb361dc183e5e949fc5c40fe04de..a65e699afb0d54c8aa46f697ab747182c8bbb816 100644 (file)
@@ -31,7 +31,9 @@ use Friendica\Core\Theme;
 use Friendica\DI;
 use Friendica\Network\HTTPException;
 use Friendica\Util\BasePath;
+use Friendica\Util\Profiler;
 use Friendica\Util\Temporal;
+use Psr\Log\LoggerInterface;
 
 class Install extends BaseModule
 {
@@ -70,16 +72,13 @@ class Install extends BaseModule
        protected $app;
        /** @var App\Mode */
        protected $mode;
-       /** @var App\BaseURL */
-       protected $baseUrl;
 
-       public function __construct(App $app, App\Mode $mode, App\BaseURL $baseUrl, App\Arguments $args, Core\Installer $installer, L10n $l10n, array $parameters = [])
+       public function __construct(App $app, App\Mode $mode, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Core\Installer $installer, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->app       = $app;
                $this->mode      = $mode;
-               $this->baseUrl   = $baseUrl;
                $this->installer = $installer;
 
                if (!$this->mode->isInstall()) {
@@ -105,7 +104,7 @@ class Install extends BaseModule
                $this->currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK;
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                $configCache = $this->app->getConfigCache();
 
@@ -187,7 +186,7 @@ class Install extends BaseModule
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $configCache = $this->app->getConfigCache();
 
index 10346a5162750b6ec864fbe619c59314419b12d1..8c9c59d304660cdcd7c24fbaf46137c0a8579766 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Util\Strings;
  */
 class Invite extends BaseModule
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
@@ -124,7 +124,7 @@ class Invite extends BaseModule
                info(DI::l10n()->tt('%d message sent.', '%d messages sent.', $total));
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
index 3936aa2bcb5730862dd5ce33d2272279b7b1a8a4..f82d1b43056fe3be0fc0cc4af1f5e2f1d32971a4 100644 (file)
@@ -38,7 +38,7 @@ use Friendica\Network\HTTPException;
  */
 class Activity extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (!Session::isAuthenticated()) {
                        throw new HTTPException\ForbiddenException();
index 6521ddc91a9c4543706c81e2fe5b624d660dcdbf..0564e2f9885f22fd305085e3d2a73775ca7c3e50 100644 (file)
@@ -40,7 +40,7 @@ use Friendica\Util\Temporal;
 
 class Compose extends BaseModule
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!empty($_REQUEST['body'])) {
                        $_REQUEST['return'] = 'network';
@@ -51,7 +51,7 @@ class Compose extends BaseModule
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        return Login::form('compose', false);
index f893531708f5635bef6a59e732e76acb959d647f..b12a0ac240a6afe60b10765566f7a6e57382f030 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Network\HTTPException;
  */
 class Follow extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $l10n = DI::l10n();
 
index 33481fd2e3d5463d3f56ced56619f9e6d107bb86..0987e75e92a637b10657d3d65b64bb5937e67a23 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Network\HTTPException;
  */
 class Ignore extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $l10n = DI::l10n();
 
index 12ff94655346f9cb3bc352ebe596407bfe046909..71aff6916dcbeb996632e7f47e9de942114d1456 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Network\HTTPException;
  */
 class Pin extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $l10n = DI::l10n();
 
index b3e4ed2a134e86b33530e00b09fa64b7daa2736b..1b581f7155a208d232a14318c6450b39ea6cc7ee 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Network\HTTPException;
  */
 class Star extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $l10n = DI::l10n();
 
index c47a7a4d504dffce50bf9e1acd7647692c8accf3..10c30c57a0ec2dd8159aa35cff83923fc375c20e 100644 (file)
@@ -31,6 +31,7 @@ use Friendica\Model\User;
 use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests;
 use Friendica\Network\HTTPClient\Client\HttpClientOptions;
 use Friendica\Util\HTTPSignature;
+use Friendica\Util\Profiler;
 use Friendica\Util\Strings;
 use Psr\Log\LoggerInterface;
 
@@ -43,26 +44,21 @@ class Magic extends BaseModule
 {
        /** @var App */
        protected $app;
-       /** @var LoggerInterface */
-       protected $logger;
        /** @var Database */
        protected $dba;
        /** @var ICanSendHttpRequests */
        protected $httpClient;
-       protected $baseUrl;
 
-       public function __construct(App $app, App\BaseURL $baseUrl, LoggerInterface $logger, Database $dba, ICanSendHttpRequests $httpClient, L10n $l10n, array $parameters = [])
+       public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Database $dba, ICanSendHttpRequests $httpClient, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->app        = $app;
-               $this->logger     = $logger;
                $this->dba        = $dba;
                $this->httpClient = $httpClient;
-               $this->baseUrl    = $baseUrl;
        }
 
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $this->logger->info('magic module: invoked');
 
index 2025a5fa4d121543f28392b617bad356cbb6d07a..b695c53ab9bf741a98c294ab4302991cb50ca308 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Util\Strings;
  */
 class Maintenance extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $reason = DI::config()->get('system', 'maintenance_reason');
 
index ff462fd3e2de79202b260c9ddbe6a5e39765f039..e23b976860bbce4859a927e7eb44c5756339afbb 100644 (file)
@@ -27,7 +27,7 @@ use Friendica\DI;
 
 class Manifest extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $config = DI::config();
 
index 06bce3e2486d97bb4c43c40f0a1ea0267d236202..131cec13c0f4a52c43d99ccc9aac41b137927b96 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Model\User;
  */
 class NoScrape extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $a = DI::app();
 
index d8f8a5049a3c1ee42051f4af3cd4c56ecb8824a2..9e5a4cac9741f5e2e5f6c5e782b83e415430009c 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Model\Nodeinfo;
  */
 class NodeInfo110 extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $config = DI::config();
 
index aac8c6d4fcd0c2e242b36b4c292ab5ec9635fe77..b0d5b18c8c147ae0d291166a82914c526810310b 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Model\Nodeinfo;
  */
 class NodeInfo120 extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $config = DI::config();
 
index cb55411f23cfbd3414f72eaf7ef12b6c932cf85b..3584e19d7380d8215ce454a393ea5f42aca37e6a 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Model\Nodeinfo;
  */
 class NodeInfo210 extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $config = DI::config();
 
index b9bbd0be93159677cd2d1a10ecdbe39cb60fdb9d..10d2bbb9fcdd0516d2f7492e58cf779b09d64a85 100644 (file)
@@ -21,6 +21,7 @@
 
 namespace Friendica\Module\Notifications;
 
+use Friendica\App;
 use Friendica\App\Arguments;
 use Friendica\App\Mode;
 use Friendica\Content\ContactSelector;
@@ -33,6 +34,8 @@ use Friendica\Model\User;
 use Friendica\Module\BaseNotifications;
 use Friendica\Navigation\Notifications\Factory\Introduction as IntroductionFactory;
 use Friendica\Navigation\Notifications\ValueObject\Introduction;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 /**
  * Prints notifications about introduction
@@ -44,9 +47,9 @@ class Introductions extends BaseNotifications
        /** @var Mode */
        protected $mode;
 
-       public function __construct(Mode $mode, IntroductionFactory $notificationIntro, Arguments $args, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Mode $mode, IntroductionFactory $notificationIntro, array $server, array $parameters = [])
        {
-               parent::__construct($args, $l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->notificationIntro = $notificationIntro;
                $this->mode              = $mode;
@@ -71,7 +74,7 @@ class Introductions extends BaseNotifications
                ];
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                Nav::setSelected('introductions');
 
index 486054f98f2461ba40222193f4c71b1b2eaef2cc..525159840f35d9e95225a53308bf5a499916a1ad 100644 (file)
@@ -42,7 +42,7 @@ class Notification extends BaseModule
         * @throws \ImagickException
         * @throws \Exception
         */
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
@@ -73,7 +73,7 @@ class Notification extends BaseModule
         *
         * @throws HTTPException\UnauthorizedException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
@@ -101,7 +101,7 @@ class Notification extends BaseModule
         * @throws HTTPException\InternalServerErrorException
         * @throws \Exception
         */
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        notice(DI::l10n()->t('You must be logged in to show this page.'));
index 269acb79db31fc38ab1c921d3acc563e2994189f..6b9a9fa28d81482a1644611778ddd2cbd92a71fc 100644 (file)
 
 namespace Friendica\Module\Notifications;
 
+use Friendica\App;
 use Friendica\App\Arguments;
-use Friendica\App\BaseURL;
 use Friendica\Content\Nav;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Module\BaseNotifications;
 use Friendica\Navigation\Notifications\ValueObject\FormattedNotification;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 /**
  * Prints all notification types except introduction:
@@ -41,15 +43,11 @@ class Notifications extends BaseNotifications
        /** @var \Friendica\Navigation\Notifications\Factory\FormattedNotification */
        protected $formattedNotificationFactory;
 
-       /** @var BaseURL */
-       protected $baseUrl;
-
-       public function __construct(BaseURL $baseUrl, \Friendica\Navigation\Notifications\Factory\FormattedNotification $formattedNotificationFactory, Arguments $args, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, \Friendica\Navigation\Notifications\Factory\FormattedNotification $formattedNotificationFactory, array $server, array $parameters = [])
        {
-               parent::__construct($args, $l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->formattedNotificationFactory = $formattedNotificationFactory;
-               $this->baseUrl                      = $baseUrl;
        }
 
        /**
@@ -96,7 +94,7 @@ class Notifications extends BaseNotifications
                ];
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                Nav::setSelected('notifications');
 
index f0915df41abc46f344504b70e62049796a477d76..f19837364d91eb246c65cf72eccfec248f51318c 100644 (file)
@@ -30,13 +30,13 @@ use Friendica\Module\BaseApi;
  */
 class Acknowledge extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                DI::session()->set('oauth_acknowledge', true);
                DI::app()->redirect(DI::session()->get('return_path'));
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                DI::session()->set('return_path', $_REQUEST['return_path'] ?? '');
 
index d39cbe353d0299b1e65c3c3081db2aa587f0ff30..851e0f4611235c7c80956fd0872afaa1c3fc4701 100644 (file)
@@ -37,7 +37,7 @@ class Authorize extends BaseApi
        /**
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $request = self::getRequest([
                        'force_login'   => '', // Forces the user to re-login, which is necessary for authorizing with multiple accounts from the same instance.
@@ -97,7 +97,7 @@ class Authorize extends BaseApi
                self::$oauth_code = $token['code'];
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (empty(self::$oauth_code)) {
                        return '';
index bf906ab454d39a0de50d2cf22d24cbf3b8b1ef1b..8e92c63c3fd1ee557182e6e2f37364fb216f694b 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Module\BaseApi;
  */
 class Revoke extends BaseApi
 {
-       public function post()
+       public function post(array $request = [], array $post = [])
        {
                $request = self::getRequest([
                        'client_id'     => '', // Client ID, obtained during app registration
index 6aef63f302940487450698d8bde4264f5e29b966..20ba22490c6d325ea4d195b571c89d1fb15d6c2c 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Security\OAuth;
  */
 class Token extends BaseApi
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                $request = self::getRequest([
                        'client_id'     => '', // Client ID, obtained during app registration
index 1b38c0e9730fd35054ee62486e6aa51d9df6b29b..f433ca188a6c20f04ad9e77fa7d50f2b4aba5054 100644 (file)
@@ -37,7 +37,7 @@ use Friendica\Util\Strings;
  */
 class Oembed extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                // Unused form: /oembed/b2h?url=...
                if (DI::args()->getArgv()[1] == 'b2h') {
index e5212c251979e412bc4a7b3cfd5f0265919a9824..1342ba3af6e7afff111e5cdae1db81de072107d0 100644 (file)
@@ -36,7 +36,7 @@ class OpenSearch extends BaseModule
        /**
         * @throws \Exception
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                header('Content-type: application/opensearchdescription+xml');
 
index 6062f2c998a32b6de67ef23a3098c1e0794d34f1..2b8aa81bdbddd6d66a03684f7440d4dede838011 100644 (file)
@@ -44,7 +44,7 @@ use Friendica\Util\Strings;
  */
 class Owa extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $ret = [ 'success' => false ];
 
index 092d6ec747bd0ac96cf495757c4f3bad7a60a6ff..7ccc8bd5707dcd1e269afb8b96cdc6e1dc38df72 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Util;
 
 class ParseUrl extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (!Session::isAuthenticated()) {
                        throw new \Friendica\Network\HTTPException\ForbiddenException();
index 1f6b58e4aa5503638e060f900ce51a411ba34668..44176ecf8d3ea002b4ac3507cd579a329b693f33 100644 (file)
@@ -15,7 +15,7 @@ use Friendica\Network\HTTPException;
  */
 class PermissionTooltip extends \Friendica\BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $type = $this->parameters['type'];
                $referenceId = $this->parameters['id'];
index 824edeb6afadeb3b989cd4ed9b55935d92aab85a..e1eae44bd78b0b8a8396e2929ae49418ada26364 100644 (file)
@@ -51,7 +51,7 @@ class Photo extends BaseModule
         * Fetch a photo or an avatar, in optional size, check for permissions and
         * return the image
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $totalstamp = microtime(true);
 
index 4a335ddf7ffaaf8d0a65dc76ba0c2587b14bde7f..2bda4466b9f2532f55756aa39b22fe1222343253 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Network\HTTPException;
 
 class Common extends BaseProfile
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
index e20fd3f2d5451d0628c7694975b3d16d6cd567be..133b2c81afe5b6578b037c78bf29281d38c89ebe 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Network\HTTPException;
 
 class Contacts extends Module\BaseProfile
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (DI::config()->get('system', 'block_public') && !Session::isAuthenticated()) {
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
index 653eb2a199c900b60fc034fc480aedc40acedfa6..3f7b3d3fd098ad8a885da6b21c77d7d999baeeb4 100644 (file)
@@ -35,13 +35,13 @@ use Friendica\Core\L10n;
  */
 class Index extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
-               (new Profile($this->l10n, $this->parameters))->rawContent();
+               (new Profile($this->l10n, $this->baseUrl, $this->args, $this->logger, $this->profiler, $this->server, $this->parameters))->rawContent();
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
-               return (new Status($this->l10n, $this->parameters))->content();
+               return (new Status($this->l10n, $this->baseUrl, $this->args, $this->logger, $this->profiler, $this->server, $this->parameters))->content();
        }
 }
index 74af5f95e28715a0451fbfc1bec430b525b5627e..049232dffb6b969f4339648c673b539da6cbd489 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\Network\HTTPException;
 
 class Media extends BaseProfile
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $a = DI::app();
 
index a497fc4dd6a721dfdf51822f2a5ea80d3a502e01..6624d993f9a28edd4e534207cd1cf4ea3ae8ba16 100644 (file)
@@ -46,7 +46,7 @@ use Friendica\Util\Temporal;
 
 class Profile extends BaseProfile
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (ActivityPub::isRequest()) {
                        $user = DBA::selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname']]);
@@ -73,7 +73,7 @@ class Profile extends BaseProfile
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $a = DI::app();
 
index 1e9cd5fa5d94fb8d866126d1720197023e575d92..c14c19b9b27b6e0f06c3991ec3f56bc1c40c855a 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Util\DateTimeFormat;
 
 class Schedule extends BaseProfile
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
@@ -50,7 +50,7 @@ class Schedule extends BaseProfile
                Post\Delayed::deleteById($_REQUEST['delete']);
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
index ad9a4acdee4f6d482d4154d1290a4d0cbec874be..a3b0ff1ea413e21f52eabc751502d2c7c380214c 100644 (file)
@@ -46,7 +46,7 @@ use Friendica\Util\XML;
 
 class Status extends BaseProfile
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $args = DI::args();
 
index abe9a8c2e9f4ba77d1f5217a8af394d04def3777..c84564e0f85213d6318f3b747c1f470c1762cf8a 100644 (file)
@@ -44,7 +44,7 @@ class Proxy extends BaseModule
        /**
         * Fetch remote image content
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $request = $this->getRequestInfo();
 
index d159255eee22d2b009704d3a1af540c61ddda2ce..f0e9dc285b39a483b30bc2fa708added0dfa57ca 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Util\Strings;
  */
 class PublicRSAKey extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (empty($this->parameters['nick'])) {
                        throw new BadRequestException();
index 38cd684294e54e3db4a394649d210dc4ad2a8be8..c4882b1bff361a7de298c98b16896ddce9e46957 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Model\Contact;
  */
 class RandomProfile extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $a = DI::app();
 
index fe071fc550b17d86f448eb473cc9932f86fc42b6..dacee205b0dd8a8d8e67b5cfa1b9f1193393f6b7 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Util\XML;
  */
 class ReallySimpleDiscovery extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                header('Content-Type: text/xml');
 
index 609e86a919307e5b0aced0dd8f84c69acc6cdd45..90c30078179fa58de981bb00031fab8e02990332 100644 (file)
@@ -21,6 +21,7 @@
 
 namespace Friendica\Module;
 
+use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\Hook;
@@ -32,7 +33,9 @@ use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model;
 use Friendica\Model\User;
+use Friendica\Util\Profiler;
 use Friendica\Util\Proxy;
+use Psr\Log\LoggerInterface;
 
 /**
  * @author Hypolite Petovan <hypolite@mrpetovan.com>
@@ -46,9 +49,9 @@ class Register extends BaseModule
        /** @var Tos */
        protected $tos;
 
-       public function __construct(Tos $tos, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Tos $tos, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->tos = $tos;
        }
@@ -62,7 +65,7 @@ class Register extends BaseModule
         *
         * @return string
         */
-       public function content(): string
+       protected function content(array $request = []): string
        {
                // logged in users can register others (people/pages/groups)
                // even with closed registrations, unless specifically prohibited by site policy.
@@ -189,7 +192,7 @@ class Register extends BaseModule
         * Extend this method if the module is supposed to process POST requests.
         * Doesn't display any content
         */
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                BaseModule::checkFormSecurityTokenRedirectOnError('/register', 'register');
 
index bc42998e30fb56a69335e79dc0c5308360fa1a8c..ee74078dde8842bb1038dcb071f5542452c28191 100644 (file)
@@ -21,7 +21,7 @@
 
 namespace Friendica\Module;
 
-use Friendica\App\BaseURL;
+use Friendica\App;
 use Friendica\App\Page;
 use Friendica\BaseModule;
 use Friendica\Content\Widget;
@@ -36,6 +36,8 @@ use Friendica\Model\Profile;
 use Friendica\Model\User;
 use Friendica\Network\HTTPException;
 use Friendica\Network\Probe;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 /**
  * Remotely follow the account on this system by the provided account
@@ -46,23 +48,20 @@ class RemoteFollow extends BaseModule
        protected $owner;
        /** @var Page */
        protected $page;
-       /** @var BaseURL */
-       protected $baseUrl;
 
-       public function __construct(L10n $l10n, Page $page, BaseURL $baseUrl, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, App\Page $page, LoggerInterface $logger, Profiler $profiler, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->owner = User::getOwnerDataByNick($this->parameters['profile']);
                if (!$this->owner) {
                        throw new HTTPException\NotFoundException($this->t('User not found.'));
                }
 
-               $this->baseUrl = $baseUrl;
                $this->page    = $page;
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!empty($_POST['cancel']) || empty($_POST['dfrn_url'])) {
                        $this->baseUrl->redirect();
@@ -106,7 +105,7 @@ class RemoteFollow extends BaseModule
                System::externalRedirect($follow_link);
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (empty($this->owner)) {
                        return '';
index ec7ee086ec640388d668f7bc811885dc77b47d10..9297c98de7b0d99d1387e1cbf2a7d85f4f9c3e0d 100644 (file)
@@ -28,7 +28,7 @@ use Friendica\BaseModule;
  */
 class RobotsTxt extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $allDisalloweds = [
                        '/settings/',
index 0866b5f9aeac430c115181236e6112cdba59e45f..ec54804002ba93bec26fa6a5f6cd1217782c7529 100644 (file)
@@ -48,7 +48,7 @@ class Acl extends BaseModule
        const TYPE_PRIVATE_MESSAGE       = 'm';
        const TYPE_ANY_CONTACT           = 'a';
 
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (!local_user()) {
                        throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
index bbd90f137d37593a4a91e8d6e799df522f85e8a2..ca57b3251d5644ee1a06de3ba2ecf992d4084b8a 100644 (file)
@@ -31,7 +31,7 @@ use Friendica\Module\Security\Login;
  */
 class Directory extends BaseSearch
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        notice(DI::l10n()->t('Permission denied.'));
index 519b0ece02b6ea34d502da3afdc526b039c1a359..cfecce8ebac289d8e6290902325317a3b2bfcdab 100644 (file)
@@ -17,7 +17,7 @@ use Friendica\Module\Security\Login;
 
 class Filed extends BaseSearch
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        return Login::form();
index 2118aeaaeeb0c4bbb22d592f205caf9b8892c700..ad90e729eddd31a35e98ddcf5a4e1d8cc5c38d85 100644 (file)
@@ -41,7 +41,7 @@ use Friendica\Network\HTTPException;
 
 class Index extends BaseSearch
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $search = (!empty($_GET['q']) ? trim(rawurldecode($_GET['q'])) : '');
 
index c9418336750bd5a458e2702fec8fbca81bad4602..fd20352bf7570552a4dfa280ec70a467512c79a9 100644 (file)
 
 namespace Friendica\Module\Search;
 
-use Friendica\App\Arguments;
-use Friendica\App\BaseURL;
+use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Core\L10n;
 use Friendica\Core\Search;
 use Friendica\Database\Database;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 class Saved extends BaseModule
 {
-       /** @var Arguments */
-       protected $args;
        /** @var Database */
        protected $dba;
-       /** @var BaseURL */
-       protected $baseUrl;
 
-       public function __construct(BaseURL $baseUrl, Database $dba, Arguments $args, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler,  Database $dba, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
-               $this->baseUrl = $baseUrl;
-               $this->dba     = $dba;
-               $this->args    = $args;
+               $this->dba = $dba;
        }
 
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $action = $this->args->get(2, 'none');
                $search = trim(rawurldecode($_GET['term'] ?? ''));
index 5c47e97496e1324743e23b5d390946ea9643c271..90f2d663a7db98d601eb3c92df2d21854ae72564 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Module\Register;
  */
 class Login extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $return_path = $_REQUEST['return_path'] ?? '' ;
 
@@ -46,7 +46,7 @@ class Login extends BaseModule
                return self::form(Session::get('return_path'), intval(DI::config()->get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED);
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                $return_path = Session::get('return_path');
                Session::clear();
index 61b32c28b96dd950210e8ec2c0e8e28cb1a488d4..b8bc0f0224279796abc20f9581253cb5153f875d 100644 (file)
@@ -21,7 +21,7 @@
 
 namespace Friendica\Module\Security;
 
-use Friendica\App\BaseURL;
+use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Core\Cache\Capability\ICanCache;
 use Friendica\Core\Hook;
@@ -31,6 +31,8 @@ use Friendica\Core\System;
 use Friendica\Model\Profile;
 use Friendica\Model\User\Cookie;
 use Friendica\Security\TwoFactor;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 /**
  * Logout module
@@ -43,19 +45,16 @@ class Logout extends BaseModule
        protected $cookie;
        /** @var IHandleSessions */
        protected $session;
-       /** @var BaseURL */
-       protected $baseUrl;
        /** @var TwoFactor\Repository\TrustedBrowser */
        protected $trustedBrowserRepo;
 
-       public function __construct(TwoFactor\Repository\TrustedBrowser $trustedBrowserRepo, ICanCache $cache, Cookie $cookie, IHandleSessions $session, BaseURL $baseUrl, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, TwoFactor\Repository\TrustedBrowser $trustedBrowserRepo, ICanCache $cache, Cookie $cookie, IHandleSessions $session, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->cache              = $cache;
                $this->cookie             = $cookie;
                $this->session            = $session;
-               $this->baseUrl            = $baseUrl;
                $this->trustedBrowserRepo = $trustedBrowserRepo;
        }
 
@@ -63,7 +62,7 @@ class Logout extends BaseModule
        /**
         * Process logout requests
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $visitor_home = null;
                if (remote_user()) {
index 360c9c672f3c6e06c029b9426b9084f29cee498e..af2b0fd0952305bcda3eb682adedc586b63958bb 100644 (file)
@@ -31,7 +31,7 @@ use LightOpenID;
  */
 class OpenID extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (DI::config()->get('system', 'no_openid')) {
                        DI::baseUrl()->redirect();
index 60de6e4048dd01b39e63338a808e5a22d2da3a99..6b5c86e661565d472e61dd927e9878c49c0fd1e8 100644 (file)
@@ -29,6 +29,8 @@ use Friendica\Core\Session\Capability\IHandleSessions;
 use Friendica\Model\User;
 use Friendica\Security\Authentication;
 use Friendica\Security\TwoFactor\Model\RecoveryCode;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 /**
  * // Page 1a: Recovery code verification
@@ -41,22 +43,19 @@ class Recovery extends BaseModule
        protected $session;
        /** @var App */
        protected $app;
-       /** @var App\BaseURL */
-       protected $baseUrl;
        /** @var Authentication */
        protected $auth;
 
-       public function __construct(App $app, App\BaseURL $baseUrl, Authentication $auth, IHandleSessions $session, L10n $l10n, array $parameters = [])
+       public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Authentication $auth, IHandleSessions $session, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->app     = $app;
-               $this->baseUrl = $baseUrl;
                $this->auth    = $auth;
                $this->session = $session;
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user()) {
                        return;
@@ -79,7 +78,7 @@ class Recovery extends BaseModule
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        $this->baseUrl->redirect();
index 3669943ba40e31735bca83eb325b7289c8806382..454cc9f7cf1366e29e4b770c069d421a05d4b61f 100644 (file)
@@ -38,7 +38,7 @@ class Verify extends BaseModule
 {
        private static $errors = [];
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user()) {
                        return;
@@ -78,7 +78,7 @@ class Verify extends BaseModule
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        DI::baseUrl()->redirect();
index a2e45883967369cc825b7f518e3044ffa2bbb626..d385544afd6bdaf40a4e46d8eb9d110204b861aa 100644 (file)
@@ -36,7 +36,7 @@ use Friendica\Util\Strings;
  */
 class Delegation extends BaseSettings
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!DI::app()->isLoggedIn()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
@@ -62,7 +62,7 @@ class Delegation extends BaseSettings
                DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => local_user()]);
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index aab8f864b1ac55aaa9d09faee93200afbd62ac5d..2155391a958ef8c5bbcf6819783b5bd0ae098282 100644 (file)
@@ -36,7 +36,7 @@ use Friendica\Network\HTTPException;
  */
 class Display extends BaseSettings
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!DI::app()->isLoggedIn()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
@@ -112,7 +112,7 @@ class Display extends BaseSettings
                DI::baseUrl()->redirect('settings/display');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 161c440b60a1f6999e330db586332647e9b9e010..9f25db524550cc887b1eaccff943a8fac8572e74 100644 (file)
@@ -41,7 +41,7 @@ use Friendica\Util\Temporal;
 
 class Index extends BaseSettings
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user()) {
                        return;
@@ -135,7 +135,7 @@ class Index extends BaseSettings
                DI::baseUrl()->redirect('settings/profile');
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        notice(DI::l10n()->t('You must be logged in to use this module'));
index 3b5f109d7941e889db90585a522c1491578173a0..a77057e1abe81ad633532ad307ea6f93da9baac7 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Network\HTTPException;
 
 class Crop extends BaseSettings
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!Session::isAuthenticated()) {
                        return;
@@ -160,7 +160,7 @@ class Crop extends BaseSettings
                DI::baseUrl()->redirect($path);
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!Session::isAuthenticated()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
index 2e65a01c61290ca593c5c2dae494fc8d4af435e6..309a893e666b618cea848f5c8aab6e8095e2fd06 100644 (file)
@@ -34,7 +34,7 @@ use Friendica\Util\Strings;
 
 class Index extends BaseSettings
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!Session::isAuthenticated()) {
                        return;
@@ -106,7 +106,7 @@ class Index extends BaseSettings
                DI::baseUrl()->redirect('settings/profile/photo/crop/' . $resource_id);
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!Session::isAuthenticated()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
index 21db4f8abfa241bcfbb93951b168c9a9080379f4..d87f27eccbfc5642a47d27bbfdf16655158b8991 100644 (file)
 
 namespace Friendica\Module\Settings\TwoFactor;
 
-use Friendica\App\BaseURL;
+use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\Renderer;
 use Friendica\Security\TwoFactor\Model\AppSpecificPassword;
 use Friendica\Module\BaseSettings;
 use Friendica\Module\Security\Login;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 /**
  * // Page 5: 2FA enabled, app-specific password generation
@@ -40,15 +42,12 @@ class AppSpecific extends BaseSettings
 
        /** @var IManagePersonalConfigValues */
        protected $pConfig;
-       /** @var BaseURL */
-       protected $baseUrl;
-       
-       public function __construct(IManagePersonalConfigValues $pConfig, BaseURL $baseUrl, L10n $l10n, array $parameters = [])
+
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, IManagePersonalConfigValues $pConfig, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->pConfig = $pConfig;
-               $this->baseUrl = $baseUrl;
 
                if (!local_user()) {
                        return;
@@ -66,7 +65,7 @@ class AppSpecific extends BaseSettings
                }
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user()) {
                        return;
@@ -109,7 +108,7 @@ class AppSpecific extends BaseSettings
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        return Login::form('settings/2fa/app_specific');
index 0dcef14ad9deb17d55bf527f9f72946fdb608132..ec57a8d147c8cd76ee625520e026d96dbc3dac18 100644 (file)
@@ -33,7 +33,7 @@ use PragmaRX\Google2FA\Google2FA;
 
 class Index extends BaseSettings
 {
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user()) {
                        return;
@@ -94,7 +94,7 @@ class Index extends BaseSettings
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        return Login::form('settings/2fa');
index 961c2cd9048695d7495d307ee43aff853bd5498e..0d324aacaf9f7d4a6a9d08995029c56aafcf0c94 100644 (file)
 
 namespace Friendica\Module\Settings\TwoFactor;
 
-use Friendica\App\BaseURL;
+use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\Renderer;
 use Friendica\Security\TwoFactor\Model\RecoveryCode;
 use Friendica\Module\BaseSettings;
 use Friendica\Module\Security\Login;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 /**
  * // Page 3: 2FA enabled but not verified, show recovery codes
@@ -38,15 +40,12 @@ class Recovery extends BaseSettings
 {
        /** @var IManagePersonalConfigValues */
        protected $pConfig;
-       /** @var BaseURL */
-       protected $baseUrl;
 
-       public function __construct(IManagePersonalConfigValues $pConfig, BaseURL $baseUrl, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, IManagePersonalConfigValues $pConfig, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->pConfig = $pConfig;
-               $this->baseUrl = $baseUrl;
 
                if (!local_user()) {
                        return;
@@ -64,7 +63,7 @@ class Recovery extends BaseSettings
                }
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user()) {
                        return;
@@ -81,7 +80,7 @@ class Recovery extends BaseSettings
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        return Login::form('settings/2fa/recovery');
index 844cd4dff4c9b91e60d7fae0f465db8bafe70fed..4e6068e237e688d08b6db23a37a92bde0c2c1714 100644 (file)
@@ -2,14 +2,16 @@
 
 namespace Friendica\Module\Settings\TwoFactor;
 
-use Friendica\App\BaseURL;
+use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\Renderer;
 use Friendica\Module\BaseSettings;
 use Friendica\Security\TwoFactor;
 use Friendica\Util\DateTimeFormat;
+use Friendica\Util\Profiler;
 use Friendica\Util\Temporal;
+use Psr\Log\LoggerInterface;
 use UAParser\Parser;
 
 /**
@@ -19,17 +21,14 @@ class Trusted extends BaseSettings
 {
        /** @var IManagePersonalConfigValues */
        protected $pConfig;
-       /** @var BaseURL */
-       protected $baseUrl;
        /** @var TwoFactor\Repository\TrustedBrowser */
        protected $trustedBrowserRepo;
 
-       public function __construct(IManagePersonalConfigValues $pConfig, BaseURL $baseUrl, TwoFactor\Repository\TrustedBrowser $trustedBrowserRepo, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, IManagePersonalConfigValues $pConfig, TwoFactor\Repository\TrustedBrowser $trustedBrowserRepo, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->pConfig            = $pConfig;
-               $this->baseUrl            = $baseUrl;
                $this->trustedBrowserRepo = $trustedBrowserRepo;
 
                if (!local_user()) {
@@ -48,7 +47,7 @@ class Trusted extends BaseSettings
                }
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user()) {
                        return;
@@ -78,7 +77,7 @@ class Trusted extends BaseSettings
        }
 
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                parent::content();
 
index 93fdde9207d5a709d85cd9d758827f0f038cb97b..29569dae0599a71158406ecf03e7b6b9e8a567c6 100644 (file)
@@ -25,14 +25,16 @@ use BaconQrCode\Renderer\Image\SvgImageBackEnd;
 use BaconQrCode\Renderer\ImageRenderer;
 use BaconQrCode\Renderer\RendererStyle\RendererStyle;
 use BaconQrCode\Writer;
-use Friendica\App\BaseURL;
+use Friendica\App;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\Renderer;
 use Friendica\Core\Session;
 use Friendica\Module\BaseSettings;
 use Friendica\Module\Security\Login;
+use Friendica\Util\Profiler;
 use PragmaRX\Google2FA\Google2FA;
+use Psr\Log\LoggerInterface;
 
 /**
  * // Page 4: 2FA enabled but not verified, QR code and verification
@@ -43,15 +45,12 @@ class Verify extends BaseSettings
 {
        /** @var IManagePersonalConfigValues */
        protected $pConfig;
-       /** @var BaseURL */
-       protected $baseUrl;
 
-       public function __construct(IManagePersonalConfigValues $pConfig, BaseURL $baseUrl, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, IManagePersonalConfigValues $pConfig, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->pConfig = $pConfig;
-               $this->baseUrl = $baseUrl;
 
                if (!local_user()) {
                        return;
@@ -70,7 +69,7 @@ class Verify extends BaseSettings
                }
        }
 
-       public function post()
+       protected function post(array $request = [], array $post = [])
        {
                if (!local_user()) {
                        return;
@@ -96,7 +95,7 @@ class Verify extends BaseSettings
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        return Login::form('settings/2fa/verify');
index b5d79c4af5ac0ab63da19aa03b87a165e16480e1..431cbfe106180517392bb63d20aea40956cc784c 100644 (file)
@@ -51,7 +51,7 @@ class UserExport extends BaseSettings
         * @throws HTTPException\ForbiddenException
         * @throws HTTPException\InternalServerErrorException
         */
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
@@ -85,7 +85,7 @@ class UserExport extends BaseSettings
         *
         * @throws HTTPException\ForbiddenException
         */
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (!DI::app()->isLoggedIn()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
index ded79800503796b26fe71db46179381a3a892622..ae368cd71cb4a82edd246db4337ea52dc7529c48 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\DI;
  */
 class Smilies extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (!empty(DI::args()->getArgv()[1]) && (DI::args()->getArgv()[1] === "json")) {
                        $smilies = Content\Smilies::getList();
@@ -45,7 +45,7 @@ class Smilies extends BaseModule
                }
        }
 
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $smilies = Content\Smilies::getList();
                $count = count($smilies['texts'] ?? []);
index f4a1334d2ec2edde2ee035c9245da4058304dde2..408999b57238a5619724ba20de28b51ea9777741 100644 (file)
 
 namespace Friendica\Module;
 
+use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Core\Addon;
 use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\L10n;
 use Friendica\Network\HTTPException\NotFoundException;
+use Friendica\Util\Profiler;
 use Psr\Log\LoggerInterface;
 
 class Statistics extends BaseModule
 {
        /** @var IManageConfigValues */
        protected $config;
-       /** @var LoggerInterface */
-       protected $logger;
 
-       public function __construct(IManageConfigValues $config, LoggerInterface $logger, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, IManageConfigValues $config, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
-               $this->logger = $logger;
                $this->config = $config;
 
                if (!$this->config->get("system", "nodeinfo")) {
@@ -47,7 +46,7 @@ class Statistics extends BaseModule
                }
        }
 
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $registration_open =
                        intval($this->config->get('config', 'register_policy')) !== Register::CLOSED
index 6c164b5ba5e26f11fdd20e4fba40fe162dc5e327..a57751ceaf0264329105af4592c904a72521f3ea 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\Util\Strings;
  */
 class Theme extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                header('Content-Type: text/css');
 
index 5b931e117244a0e1696e240956fa1a2cf48739ba..82d2ff18601486a16fe2e7c7982827f5b2985953 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\Core\Theme;
  */
 class ThemeDetails extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (!empty($_REQUEST['theme'])) {
                        $theme = $_REQUEST['theme'];
index a0fb2f88f648904fe142fb6c55ee92c697add858..5817394cec211a08c775ad053d2c42f29f3591e9 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\DI;
  */
 class ToggleMobile extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $a = DI::app();
 
index 1b71627535798734e6ed12fcecd6450406c815bc..53ef9492059e59a5e9fec1fab8d6a998a8105888 100644 (file)
 
 namespace Friendica\Module;
 
-use Friendica\App\BaseURL;
+use Friendica\App;
 use Friendica\BaseModule;
 use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Content\Text\BBCode;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
 
 class Tos extends BaseModule
 {
@@ -38,8 +40,6 @@ class Tos extends BaseModule
 
        /** @var IManageConfigValues */
        protected $config;
-       /** @var BaseURL */
-       protected $baseUrl;
 
        /**
         * constructor for the module, initializing the text variables
@@ -48,12 +48,11 @@ class Tos extends BaseModule
         * be properties of the class, however cannot be set directly as the property
         * cannot depend on a function result when declaring the variable.
         **/
-       public function __construct(IManageConfigValues $config, BaseURL $baseUrl, L10n $l10n, array $parameters = [])
+       public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, IManageConfigValues $config, array $server, array $parameters = [])
        {
-               parent::__construct($l10n, $parameters);
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
 
                $this->config  = $config;
-               $this->baseUrl = $baseUrl;
 
                $this->privacy_operate    = $this->t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.');
                $this->privacy_distribute = $this->t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.');
@@ -76,7 +75,7 @@ class Tos extends BaseModule
         * @return string
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public function content(): string
+       protected function content(array $request = []): string
        {
                if (strlen($this->config->get('system', 'singleuser'))) {
                        $this->baseUrl->redirect('profile/' . $this->config->get('system', 'singleuser'));
index 07ed5a610fe380a4861e4be27aadaaf2273b9c9b..9a1ffd771f70ef09a2f0b71bc3aae12fcb13fbea 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Module\Conversation\Community as CommunityModule;
  */
 class Community extends CommunityModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $this->parseRequest();
 
index 3652b1126330ff22bd621d0438d62c220dd33ac8..073df23810400175dedbccb8f42557111e498b75 100644 (file)
@@ -9,7 +9,7 @@ use Friendica\Module\Conversation\Network as NetworkModule;
 
 class Network extends NetworkModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                if (!isset($_GET['p']) || !isset($_GET['item'])) {
                        exit();
index b06aea804449f5218d302866c0e5198a27dfe4cb..691d9d955dde8b4b6336868753d6263d18cb5c96 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\Util\DateTimeFormat;
 
 class Profile extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $a = DI::app();
 
@@ -93,7 +93,7 @@ class Profile extends BaseModule
                );
 
                if (!DBA::isResult($items_stmt)) {
-                       return '';
+                       return;
                }
 
                // Set a time stamp for this page. We will make use of it when we
index 92845cdaffc928a9f8829a09818551dad1aeacb4..9144541cbc5dac68e012fdcdab01d7588b0c3956 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\DI;
  */
 class Welcome extends BaseModule
 {
-       public function content(): string
+       protected function content(array $request = []): string
        {
                $config = DI::config();
 
index a65b4db1a15e2580856b9482c20d02226288fd04..485004d70cfa3cc5f31bcd12bdaf1b8e78e6188c 100644 (file)
@@ -33,7 +33,7 @@ use Friendica\Util\Crypto;
  */
 class HostMeta extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $config = DI::config();
 
index a4197928067eedfeb0483407ba36ba541e39ea8e..403c26f21c2e7c8a4608b14c384a08d67a4ae6ef 100644 (file)
@@ -30,7 +30,7 @@ use Friendica\DI;
  */
 class NodeInfo extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                self::printWellKnown();
        }
index 73a627c2e7953d1c8d99c0a73de9983a8363d3e1..1455db130fc2d6c0c0b02f5f8fe80d1e5fb686a6 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\BaseModule;
  */
 class SecurityTxt extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $name = 'security.txt';
                $fp = fopen($name, 'rt');
index c401825236c72907829d9e096fc5e8dd2c68d797..dc29f089a276b79aed4a5c97551b0263f434f3dd 100644 (file)
@@ -32,7 +32,7 @@ use Friendica\Protocol\Relay;
  */
 class XSocialRelay extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                $config = DI::config();
 
index 4a8e32e8eaa91b9a4c5321b7420be0aca13a98b0..5d3205b7a1f6466da1cf8ab1b2aea1004ba47115 100644 (file)
@@ -36,7 +36,7 @@ use Friendica\Protocol\Salmon;
  */
 class Xrd extends BaseModule
 {
-       public function rawContent()
+       protected function rawContent(array $request = [])
        {
                // @TODO: Replace with parameter from router
                if (DI::args()->getArgv()[0] == 'xrd') {