]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Settings/UserExport.php
Issue 11870: Weeks can now start at every day
[friendica.git] / src / Module / Settings / UserExport.php
index aad76c4fbcbf1ed9382d231fb41be8b3dcd20f3c..4dfbdb99eb2fdaab539d256a24a5fe2f04a8c3ef 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
- * @license   GNU AGPL version 3 or any later version
+ * @license GNU AGPL version 3 or any later version
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as
@@ -23,6 +23,7 @@ namespace Friendica\Module\Settings;
 
 use Friendica\Core\Hook;
 use Friendica\Core\Renderer;
+use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Database\DBStructure;
 use Friendica\DI;
@@ -47,18 +48,17 @@ class UserExport extends BaseSettings
         * If there is an action required through the URL / path, react
         * accordingly and export the requested data.
         *
-        * @param array $parameters Router-supplied parameters
         * @return string
         * @throws HTTPException\ForbiddenException
         * @throws HTTPException\InternalServerErrorException
         */
-       public static function content(array $parameters = [])
+       protected function content(array $request = []): string
        {
                if (!local_user()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
                }
 
-               parent::content($parameters);
+               parent::content();
 
                /**
                 * options shown on "Export personal data" page
@@ -84,10 +84,9 @@ class UserExport extends BaseSettings
         * to the browser which then offers a save / open dialog
         * to the user.
         *
-        * @param array $parameters Router-supplied parameters
         * @throws HTTPException\ForbiddenException
         */
-       public static function rawContent(array $parameters = [])
+       protected function rawContent(array $request = [])
        {
                if (!DI::app()->isLoggedIn()) {
                        throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
@@ -114,8 +113,7 @@ class UserExport extends BaseSettings
                                        self::exportContactsAsCSV(local_user());
                                        break;
                        }
-
-                       exit();
+                       System::exit();
                }
        }
 
@@ -126,7 +124,7 @@ class UserExport extends BaseSettings
         */
        private static function exportMultiRow(string $query)
        {
-               $dbStructure = DBStructure::definition(DI::app()->getBasePath(), false);
+               $dbStructure = DI::dbaDefinition()->getAll();
 
                preg_match("/\s+from\s+`?([a-z\d_]+)`?/i", $query, $match);
                $table = $match[1];
@@ -158,7 +156,7 @@ class UserExport extends BaseSettings
         */
        private static function exportRow(string $query)
        {
-               $dbStructure = DBStructure::definition(DI::app()->getBasePath(), false);
+               $dbStructure = DI::dbaDefinition()->getAll();
 
                preg_match("/\s+from\s+`?([a-z\d_]+)`?/i", $query, $match);
                $table = $match[1];