From 30e02beb461bcfe564f69479e5562f620896f28b Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Nov 2019 19:16:11 +0000 Subject: [PATCH 01/10] New module to pin posts --- src/Module/Pinned.php | 60 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/Module/Pinned.php diff --git a/src/Module/Pinned.php b/src/Module/Pinned.php new file mode 100644 index 0000000000..590bda159e --- /dev/null +++ b/src/Module/Pinned.php @@ -0,0 +1,60 @@ +argc > 1) { + $itemId = intval($a->argv[1]); + } + + if (!$itemId) { + exit(); + } + + $item = Item::selectFirstForUser(local_user(), ['pinned'], ['uid' => local_user(), 'id' => $itemId]); + if (empty($item)) { + exit(); + } + + if (!intval($item['pinned'])) { + $pinned = 1; + } + + Item::update(['pinned' => $pinned], ['id' => $itemId]); + + // See if we've been passed a return path to redirect to + $returnPath = $_REQUEST['return'] ?? ''; + if ($returnPath) { + $rand = '_=' . time(); + if (strpos($returnPath, '?')) { + $rand = "&$rand"; + } else { + $rand = "?$rand"; + } + + $a->internalRedirect($returnPath . $rand); + } + + // the json doesn't really matter, it will either be 0 or 1 + echo json_encode($pinned); + exit(); + } +} From abe6724629b851c6cce965a0aa03658b9dae8c62 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Nov 2019 19:16:26 +0000 Subject: [PATCH 02/10] Added parameter to rawContent --- src/BaseModule.php | 2 +- .../AccountManagementControlDocument.php | 2 +- src/Module/Admin/PhpInfo.php | 4 +- src/Module/Attach.php | 2 +- src/Module/BaseAdminModule.php | 2 +- src/Module/Contact/Hovercard.php | 2 +- src/Module/Diaspora/Fetch.php | 2 +- src/Module/Filer/SaveTag.php | 2 +- src/Module/Followers.php | 2 +- src/Module/Following.php | 2 +- src/Module/Friendica.php | 2 +- src/Module/Inbox.php | 2 +- src/Module/Item/Ignore.php | 2 +- src/Module/Like.php | 2 +- src/Module/Manifest.php | 2 +- src/Module/NodeInfo.php | 2 +- src/Module/Notifications/Notify.php | 2 +- src/Module/Objects.php | 2 +- src/Module/OpenSearch.php | 2 +- src/Module/Outbox.php | 2 +- src/Module/Profile.php | 2 +- src/Module/PublicRSAKey.php | 2 +- src/Module/ReallySimpleDiscovery.php | 2 +- src/Module/RobotsTxt.php | 2 +- src/Module/Search/Acl.php | 2 +- src/Module/Settings/UserExport.php | 2 +- src/Module/Smilies.php | 2 +- src/Module/Starred.php | 37 ++++++------------- src/Module/Statistics.php | 2 +- src/Module/Theme.php | 2 +- src/Module/ThemeDetails.php | 2 +- src/Module/WellKnown/HostMeta.php | 2 +- src/Module/WellKnown/XSocialRelay.php | 2 +- src/Module/Xrd.php | 2 +- static/dbstructure.config.php | 5 ++- static/routes.config.php | 5 ++- 36 files changed, 51 insertions(+), 64 deletions(-) diff --git a/src/BaseModule.php b/src/BaseModule.php index 5185771d1c..e049e9a944 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -32,7 +32,7 @@ abstract class BaseModule extends BaseObject * Extend this method if the module is supposed to return communication data, * e.g. from protocol implementations. */ - public static function rawContent() + public static function rawContent($parameters) { // echo ''; // exit; diff --git a/src/Module/AccountManagementControlDocument.php b/src/Module/AccountManagementControlDocument.php index 2e2a9e496d..0cf1de6f15 100644 --- a/src/Module/AccountManagementControlDocument.php +++ b/src/Module/AccountManagementControlDocument.php @@ -11,7 +11,7 @@ use Friendica\BaseModule; */ class AccountManagementControlDocument extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $output = [ 'version' => 1, diff --git a/src/Module/Admin/PhpInfo.php b/src/Module/Admin/PhpInfo.php index b912117dc1..9c7b597514 100644 --- a/src/Module/Admin/PhpInfo.php +++ b/src/Module/Admin/PhpInfo.php @@ -6,9 +6,9 @@ use Friendica\Module\BaseAdminModule; class PhpInfo extends BaseAdminModule { - public static function rawContent() + public static function rawContent($parameters) { - parent::rawContent(); + parent::rawContent($parameters); phpinfo(); exit(); diff --git a/src/Module/Attach.php b/src/Module/Attach.php index e9af90facc..fe0e063b02 100644 --- a/src/Module/Attach.php +++ b/src/Module/Attach.php @@ -20,7 +20,7 @@ class Attach extends BaseModule /** * @brief Return to user an attached file given the id */ - public static function rawContent() + public static function rawContent($parameters) { $a = self::getApp(); if ($a->argc != 2) { diff --git a/src/Module/BaseAdminModule.php b/src/Module/BaseAdminModule.php index 6802d09c18..61b3b4ff9f 100644 --- a/src/Module/BaseAdminModule.php +++ b/src/Module/BaseAdminModule.php @@ -35,7 +35,7 @@ abstract class BaseAdminModule extends BaseModule } } - public static function rawContent() + public static function rawContent($parameters) { if (!is_site_admin()) { return ''; diff --git a/src/Module/Contact/Hovercard.php b/src/Module/Contact/Hovercard.php index 20290e0aca..7f314d361a 100644 --- a/src/Module/Contact/Hovercard.php +++ b/src/Module/Contact/Hovercard.php @@ -18,7 +18,7 @@ use Friendica\Util\Proxy; */ class Hovercard extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $contact_url = $_REQUEST['url'] ?? ''; diff --git a/src/Module/Diaspora/Fetch.php b/src/Module/Diaspora/Fetch.php index 467d64566b..b69cd1f12b 100644 --- a/src/Module/Diaspora/Fetch.php +++ b/src/Module/Diaspora/Fetch.php @@ -17,7 +17,7 @@ use Friendica\Util\Strings; */ class Fetch extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $app = self::getApp(); diff --git a/src/Module/Filer/SaveTag.php b/src/Module/Filer/SaveTag.php index e8e3112681..14eb368baa 100644 --- a/src/Module/Filer/SaveTag.php +++ b/src/Module/Filer/SaveTag.php @@ -22,7 +22,7 @@ class SaveTag extends BaseModule } } - public static function rawContent() + public static function rawContent($parameters) { $a = self::getApp(); $logger = $a->getLogger(); diff --git a/src/Module/Followers.php b/src/Module/Followers.php index 5bd3fe0ce2..34cb0cdbf9 100644 --- a/src/Module/Followers.php +++ b/src/Module/Followers.php @@ -14,7 +14,7 @@ use Friendica\Protocol\ActivityPub; */ class Followers extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $a = self::getApp(); diff --git a/src/Module/Following.php b/src/Module/Following.php index 5b5f4dc986..cbf33d50f0 100644 --- a/src/Module/Following.php +++ b/src/Module/Following.php @@ -14,7 +14,7 @@ use Friendica\Protocol\ActivityPub; */ class Following extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $a = self::getApp(); diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php index ae8ea14968..cadacb48b3 100644 --- a/src/Module/Friendica.php +++ b/src/Module/Friendica.php @@ -88,7 +88,7 @@ class Friendica extends BaseModule ]); } - public static function rawContent() + public static function rawContent($parameters) { $app = self::getApp(); diff --git a/src/Module/Inbox.php b/src/Module/Inbox.php index 2cc273b139..ac99327735 100644 --- a/src/Module/Inbox.php +++ b/src/Module/Inbox.php @@ -19,7 +19,7 @@ use Friendica\Util\Network; */ class Inbox extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $a = self::getApp(); diff --git a/src/Module/Item/Ignore.php b/src/Module/Item/Ignore.php index 6a28310b40..662148076c 100644 --- a/src/Module/Item/Ignore.php +++ b/src/Module/Item/Ignore.php @@ -16,7 +16,7 @@ use Friendica\Network\HTTPException; */ class Ignore extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { /** @var L10n $l10n */ $l10n = self::getClass(L10n::class); diff --git a/src/Module/Like.php b/src/Module/Like.php index cc450dd9d0..3243a12cb9 100644 --- a/src/Module/Like.php +++ b/src/Module/Like.php @@ -13,7 +13,7 @@ use Friendica\Util\Strings; */ class Like extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { if (!Session::isAuthenticated()) { throw new HTTPException\ForbiddenException(); diff --git a/src/Module/Manifest.php b/src/Module/Manifest.php index 9dadcf0f76..2fe432a5f4 100644 --- a/src/Module/Manifest.php +++ b/src/Module/Manifest.php @@ -7,7 +7,7 @@ use Friendica\Core\Renderer; class Manifest extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $app = self::getApp(); $config = $app->getConfig(); diff --git a/src/Module/NodeInfo.php b/src/Module/NodeInfo.php index 3261ef6902..f4ecc5da68 100644 --- a/src/Module/NodeInfo.php +++ b/src/Module/NodeInfo.php @@ -22,7 +22,7 @@ class NodeInfo extends BaseModule } } - public static function rawContent() + public static function rawContent($parameters) { $app = self::getApp(); diff --git a/src/Module/Notifications/Notify.php b/src/Module/Notifications/Notify.php index bad0900ea2..360204d94b 100644 --- a/src/Module/Notifications/Notify.php +++ b/src/Module/Notifications/Notify.php @@ -21,7 +21,7 @@ class Notify extends BaseModule } } - public static function rawContent() + public static function rawContent($parameters) { $a = self::getApp(); diff --git a/src/Module/Objects.php b/src/Module/Objects.php index 2104e8042f..528b20a86c 100644 --- a/src/Module/Objects.php +++ b/src/Module/Objects.php @@ -15,7 +15,7 @@ use Friendica\Protocol\ActivityPub; */ class Objects extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $a = self::getApp(); diff --git a/src/Module/OpenSearch.php b/src/Module/OpenSearch.php index ff005bd56b..89cf53055d 100644 --- a/src/Module/OpenSearch.php +++ b/src/Module/OpenSearch.php @@ -16,7 +16,7 @@ class OpenSearch extends BaseModule /** * @throws \Exception */ - public static function rawContent() + public static function rawContent($parameters) { header('Content-type: application/opensearchdescription+xml'); diff --git a/src/Module/Outbox.php b/src/Module/Outbox.php index 4fc0507631..334e7af718 100644 --- a/src/Module/Outbox.php +++ b/src/Module/Outbox.php @@ -14,7 +14,7 @@ use Friendica\Protocol\ActivityPub; */ class Outbox extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $a = self::getApp(); diff --git a/src/Module/Profile.php b/src/Module/Profile.php index f38c77f2cd..ab2fad2e2f 100644 --- a/src/Module/Profile.php +++ b/src/Module/Profile.php @@ -51,7 +51,7 @@ class Profile extends BaseModule } } - public static function rawContent() + public static function rawContent($parameters) { if (ActivityPub::isRequest()) { $user = DBA::selectFirst('user', ['uid'], ['nickname' => self::$which]); diff --git a/src/Module/PublicRSAKey.php b/src/Module/PublicRSAKey.php index ed099616ad..36502cc86b 100644 --- a/src/Module/PublicRSAKey.php +++ b/src/Module/PublicRSAKey.php @@ -12,7 +12,7 @@ use Friendica\Network\HTTPException\BadRequestException; */ class PublicRSAKey extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $app = self::getApp(); diff --git a/src/Module/ReallySimpleDiscovery.php b/src/Module/ReallySimpleDiscovery.php index 515285dbfc..838843fbf0 100644 --- a/src/Module/ReallySimpleDiscovery.php +++ b/src/Module/ReallySimpleDiscovery.php @@ -11,7 +11,7 @@ use Friendica\Util\XML; */ class ReallySimpleDiscovery extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { header('Content-Type: text/xml'); diff --git a/src/Module/RobotsTxt.php b/src/Module/RobotsTxt.php index 635056a0ad..47e11201d9 100644 --- a/src/Module/RobotsTxt.php +++ b/src/Module/RobotsTxt.php @@ -9,7 +9,7 @@ use Friendica\BaseModule; */ class RobotsTxt extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $allDisalloweds = [ '/settings/', diff --git a/src/Module/Search/Acl.php b/src/Module/Search/Acl.php index 1016756008..e886a8fdb9 100644 --- a/src/Module/Search/Acl.php +++ b/src/Module/Search/Acl.php @@ -31,7 +31,7 @@ class Acl extends BaseModule const TYPE_PRIVATE_MESSAGE = 'm'; const TYPE_ANY_CONTACT = 'a'; - public static function rawContent() + public static function rawContent($parameters) { if (!local_user()) { throw new HTTPException\UnauthorizedException(L10n::t('You must be logged in to use this module.')); diff --git a/src/Module/Settings/UserExport.php b/src/Module/Settings/UserExport.php index d5b8f88ec1..9c4e4913cf 100644 --- a/src/Module/Settings/UserExport.php +++ b/src/Module/Settings/UserExport.php @@ -59,7 +59,7 @@ class UserExport extends BaseSettingsModule * to the browser which then offers a save / open dialog * to the user. **/ - public static function rawContent() + public static function rawContent($parameters) { $args = self::getClass(Arguments::class); if ($args->getArgc() == 3) { diff --git a/src/Module/Smilies.php b/src/Module/Smilies.php index ded58768fe..9a81a888e9 100644 --- a/src/Module/Smilies.php +++ b/src/Module/Smilies.php @@ -12,7 +12,7 @@ use Friendica\Core\System; */ class Smilies extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $app = self::getApp(); diff --git a/src/Module/Starred.php b/src/Module/Starred.php index 70cd397351..5c79c4fac8 100644 --- a/src/Module/Starred.php +++ b/src/Module/Starred.php @@ -4,29 +4,23 @@ namespace Friendica\Module; use Friendica\BaseModule; use Friendica\Model\Item; +use Friendica\Core\System; /** * Toggle starred items */ class Starred extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { - $a = self::getApp(); - $starred = 0; - $itemId = null; - if (!local_user()) { exit(); } - // @TODO: Replace with parameter from router - if ($a->argc > 1) { - $itemId = intval($a->argv[1]); - } - - if (!$itemId) { - exit(); + if (empty($parameters['item'])) { + exit; + } else { + $itemId = intval($parameters['item']); } $item = Item::selectFirstForUser(local_user(), ['starred'], ['uid' => local_user(), 'id' => $itemId]); @@ -34,27 +28,18 @@ class Starred extends BaseModule exit(); } - if (!intval($item['starred'])) { - $starred = 1; - } + $starred = !$item['starred']; Item::update(['starred' => $starred], ['id' => $itemId]); // See if we've been passed a return path to redirect to $returnPath = $_REQUEST['return'] ?? ''; - if ($returnPath) { - $rand = '_=' . time(); - if (strpos($returnPath, '?')) { - $rand = "&$rand"; - } else { - $rand = "?$rand"; - } - - $a->internalRedirect($returnPath . $rand); + if (!empty($returnPath)) { + $rand = '_=' . time() . (strpos($returnPath, '?') ? '&' : '?') . 'rand'; + self::getApp()->internalRedirect($returnPath . $rand); } // the json doesn't really matter, it will either be 0 or 1 - echo json_encode($starred); - exit(); + System::jsonExit($starred); } } diff --git a/src/Module/Statistics.php b/src/Module/Statistics.php index 3e64828e7b..7400943237 100644 --- a/src/Module/Statistics.php +++ b/src/Module/Statistics.php @@ -17,7 +17,7 @@ class Statistics extends BaseModule } } - public static function rawContent() + public static function rawContent($parameters) { $config = self::getApp()->getConfig(); $logger = self::getApp()->getLogger(); diff --git a/src/Module/Theme.php b/src/Module/Theme.php index 0540267af7..762e398556 100644 --- a/src/Module/Theme.php +++ b/src/Module/Theme.php @@ -10,7 +10,7 @@ use Friendica\Util\Strings; */ class Theme extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { header("Content-Type: text/css"); diff --git a/src/Module/ThemeDetails.php b/src/Module/ThemeDetails.php index 9a2e913bca..611134d638 100644 --- a/src/Module/ThemeDetails.php +++ b/src/Module/ThemeDetails.php @@ -10,7 +10,7 @@ use Friendica\Core\Theme; */ class ThemeDetails extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { if (!empty($_REQUEST['theme'])) { $theme = $_REQUEST['theme']; diff --git a/src/Module/WellKnown/HostMeta.php b/src/Module/WellKnown/HostMeta.php index fd04467f75..acf2cca866 100644 --- a/src/Module/WellKnown/HostMeta.php +++ b/src/Module/WellKnown/HostMeta.php @@ -13,7 +13,7 @@ use Friendica\Util\Crypto; */ class HostMeta extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $app = self::getApp(); $config = $app->getConfig(); diff --git a/src/Module/WellKnown/XSocialRelay.php b/src/Module/WellKnown/XSocialRelay.php index a1bbeb78aa..bbd51069d9 100644 --- a/src/Module/WellKnown/XSocialRelay.php +++ b/src/Module/WellKnown/XSocialRelay.php @@ -11,7 +11,7 @@ use Friendica\Model\Search; */ class XSocialRelay extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $app = self::getApp(); $config = $app->getConfig(); diff --git a/src/Module/Xrd.php b/src/Module/Xrd.php index 1028bfd531..4bad558a4e 100644 --- a/src/Module/Xrd.php +++ b/src/Module/Xrd.php @@ -17,7 +17,7 @@ use Friendica\Util\Strings; */ class Xrd extends BaseModule { - public static function rawContent() + public static function rawContent($parameters) { $app = self::getApp(); diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 53f8a8ed44..65e0b26a6a 100755 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -34,7 +34,7 @@ use Friendica\Database\DBA; if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1323); + define('DB_UPDATE_VERSION', 1324); } return [ @@ -1384,7 +1384,8 @@ return [ "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"], "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"], "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"], - "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"] + "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"], + "pinned" => ["type" => "boolean", "comment" => "The item is pinned on the profile page"] ], "indexes" => [ "PRIMARY" => ["uid", "iid"] diff --git a/static/routes.config.php b/static/routes.config.php index 1f2fe0ad1b..339860afe6 100644 --- a/static/routes.config.php +++ b/static/routes.config.php @@ -179,8 +179,9 @@ return [ '/{type}/{customize}/{name}' => [Module\Photo::class, [R::GET]], ], - '/pretheme' => [Module\ThemeDetails::class, [R::GET]], - '/probe' => [Module\Debug\Probe::class, [R::GET]], + '/pinned/{item:\d+}' => [Module\Pinned::class, [R::GET]], + '/pretheme' => [Module\ThemeDetails::class, [R::GET]], + '/probe' => [Module\Debug\Probe::class, [R::GET]], '/profile' => [ '/{nickname}' => [Module\Profile::class, [R::GET]], From bd62d548db39b617d087aabb536435004adf0470 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Nov 2019 20:22:54 +0000 Subject: [PATCH 03/10] Added parameters --- src/App/Page.php | 2 +- src/BaseModule.php | 13 ++++-------- src/LegacyModule.php | 20 +++++++++---------- src/Module/Acctlink.php | 2 +- src/Module/Admin/Addons/Details.php | 8 ++++---- src/Module/Admin/Addons/Index.php | 4 ++-- src/Module/Admin/Blocklist/Contact.php | 8 ++++---- src/Module/Admin/Blocklist/Server.php | 8 ++++---- src/Module/Admin/DBSync.php | 4 ++-- src/Module/Admin/Features.php | 8 ++++---- src/Module/Admin/Federation.php | 4 ++-- src/Module/Admin/Item/Delete.php | 8 ++++---- src/Module/Admin/Item/Source.php | 4 ++-- src/Module/Admin/Logs/Settings.php | 8 ++++---- src/Module/Admin/Logs/View.php | 4 ++-- src/Module/Admin/Queue.php | 4 ++-- src/Module/Admin/Site.php | 8 ++++---- src/Module/Admin/Summary.php | 4 ++-- src/Module/Admin/Themes/Details.php | 8 ++++---- src/Module/Admin/Themes/Embed.php | 10 +++++----- src/Module/Admin/Themes/Index.php | 4 ++-- src/Module/Admin/Tos.php | 8 ++++---- src/Module/Admin/Users.php | 8 ++++---- src/Module/AllFriends.php | 2 +- src/Module/Apps.php | 4 ++-- src/Module/BaseAdminModule.php | 4 ++-- src/Module/BaseSettingsModule.php | 2 +- src/Module/Bookmarklet.php | 2 +- src/Module/Contact.php | 2 +- src/Module/Credits.php | 2 +- src/Module/Debug/Babel.php | 2 +- src/Module/Debug/Feed.php | 4 ++-- src/Module/Debug/ItemBody.php | 2 +- src/Module/Debug/Localtime.php | 4 ++-- src/Module/Debug/Probe.php | 2 +- src/Module/Debug/WebFinger.php | 2 +- src/Module/Delegation.php | 4 ++-- src/Module/Diaspora/Receive.php | 4 ++-- src/Module/Directory.php | 2 +- src/Module/Feed.php | 2 +- src/Module/Filer/RemoveTag.php | 2 +- src/Module/Filer/SaveTag.php | 2 +- src/Module/FollowConfirm.php | 2 +- src/Module/Friendica.php | 2 +- src/Module/Group.php | 4 ++-- src/Module/HTTPException/MethodNotAllowed.php | 2 +- src/Module/HTTPException/PageNotFound.php | 2 +- src/Module/Hashtag.php | 2 +- src/Module/Help.php | 2 +- src/Module/Home.php | 2 +- src/Module/Install.php | 6 +++--- src/Module/Invite.php | 4 ++-- src/Module/Item/Compose.php | 4 ++-- src/Module/Login.php | 4 ++-- src/Module/Logout.php | 2 +- src/Module/Magic.php | 2 +- src/Module/Maintenance.php | 2 +- src/Module/NodeInfo.php | 2 +- src/Module/Notifications/Notify.php | 4 ++-- src/Module/Oembed.php | 2 +- src/Module/Owa.php | 2 +- src/Module/Photo.php | 2 +- src/Module/Profile.php | 2 +- src/Module/Profile/Contacts.php | 2 +- src/Module/Proxy.php | 2 +- src/Module/RandomProfile.php | 2 +- src/Module/Register.php | 4 ++-- src/Module/Search/Directory.php | 2 +- src/Module/Search/Index.php | 2 +- src/Module/Search/Saved.php | 2 +- src/Module/Settings/Delegation.php | 6 +++--- src/Module/Settings/TwoFactor/AppSpecific.php | 8 ++++---- src/Module/Settings/TwoFactor/Index.php | 6 +++--- src/Module/Settings/TwoFactor/Recovery.php | 8 ++++---- src/Module/Settings/TwoFactor/Verify.php | 8 ++++---- src/Module/Settings/UserExport.php | 4 ++-- src/Module/Smilies.php | 2 +- src/Module/Starred.php | 6 +++--- src/Module/Statistics.php | 2 +- src/Module/ToggleMobile.php | 2 +- src/Module/Tos.php | 4 ++-- src/Module/TwoFactor/Recovery.php | 6 +++--- src/Module/TwoFactor/Verify.php | 4 ++-- src/Module/Welcome.php | 2 +- 84 files changed, 172 insertions(+), 177 deletions(-) diff --git a/src/App/Page.php b/src/App/Page.php index ea94f9cfef..de75db32fe 100644 --- a/src/App/Page.php +++ b/src/App/Page.php @@ -308,7 +308,7 @@ class Page implements ArrayAccess $arr = ['content' => $content]; Hook::callAll($moduleClass . '_mod_content', $arr); $content = $arr['content']; - $arr = ['content' => call_user_func([$moduleClass, 'content'])]; + $arr = ['content' => call_user_func([$moduleClass, 'content'], [])]; Hook::callAll($moduleClass . '_mod_aftercontent', $arr); $content .= $arr['content']; } catch (HTTPException $e) { diff --git a/src/BaseModule.php b/src/BaseModule.php index e049e9a944..3bc2ac9ff2 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -22,7 +22,7 @@ abstract class BaseModule extends BaseObject * Extend this method if you need to do any shared processing before both * content() or post() */ - public static function init() + public static function init($parameters) { } @@ -34,8 +34,6 @@ abstract class BaseModule extends BaseObject */ public static function rawContent($parameters) { - // echo ''; - // exit; } /** @@ -47,7 +45,7 @@ abstract class BaseModule extends BaseObject * * @return string */ - public static function content() + public static function content($parameters) { $o = ''; @@ -60,10 +58,8 @@ abstract class BaseModule extends BaseObject * Extend this method if the module is supposed to process POST requests. * Doesn't display any content */ - public static function post() + public static function post($parameters) { - // $a = self::getApp(); - // $a->internalRedirect('module'); } /** @@ -71,9 +67,8 @@ abstract class BaseModule extends BaseObject * * Unknown purpose */ - public static function afterpost() + public static function afterpost($parameters) { - } /* diff --git a/src/LegacyModule.php b/src/LegacyModule.php index a0b23a5419..7252e7bef3 100644 --- a/src/LegacyModule.php +++ b/src/LegacyModule.php @@ -35,24 +35,24 @@ class LegacyModule extends BaseModule require_once $file_path; } - public static function init() + public static function init($parameters) { - self::runModuleFunction('init'); + self::runModuleFunction('init', $parameters); } - public static function content() + public static function content($parameters) { - return self::runModuleFunction('content'); + return self::runModuleFunction('content', $parameters); } - public static function post() + public static function post($parameters) { - self::runModuleFunction('post'); + self::runModuleFunction('post', $parameters); } - public static function afterpost() + public static function afterpost($parameters) { - self::runModuleFunction('afterpost'); + self::runModuleFunction('afterpost', $parameters); } /** @@ -62,7 +62,7 @@ class LegacyModule extends BaseModule * @return string * @throws \Exception */ - private static function runModuleFunction($function_suffix) + private static function runModuleFunction($function_suffix, $parameters) { $function_name = static::$moduleName . '_' . $function_suffix; @@ -70,7 +70,7 @@ class LegacyModule extends BaseModule $a = self::getApp(); return $function_name($a); } else { - return parent::{$function_suffix}(); + return parent::{$function_suffix}($parameters); } } } diff --git a/src/Module/Acctlink.php b/src/Module/Acctlink.php index 1c2500a224..bef407eb1c 100644 --- a/src/Module/Acctlink.php +++ b/src/Module/Acctlink.php @@ -11,7 +11,7 @@ use Friendica\Core\System; */ class Acctlink extends BaseModule { - public static function content() + public static function content($parameters) { $addr = trim($_GET['addr'] ?? ''); diff --git a/src/Module/Admin/Addons/Details.php b/src/Module/Admin/Addons/Details.php index 1965102f03..7508cdbf69 100644 --- a/src/Module/Admin/Addons/Details.php +++ b/src/Module/Admin/Addons/Details.php @@ -11,9 +11,9 @@ use Friendica\Util\Strings; class Details extends BaseAdminModule { - public static function post() + public static function post($parameters) { - parent::post(); + parent::post($parameters); $a = self::getApp(); @@ -35,9 +35,9 @@ class Details extends BaseAdminModule $a->internalRedirect('admin/addons'); } - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $a = self::getApp(); diff --git a/src/Module/Admin/Addons/Index.php b/src/Module/Admin/Addons/Index.php index eed47defb4..645bd431e3 100644 --- a/src/Module/Admin/Addons/Index.php +++ b/src/Module/Admin/Addons/Index.php @@ -9,9 +9,9 @@ use Friendica\Module\BaseAdminModule; class Index extends BaseAdminModule { - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $a = self::getApp(); diff --git a/src/Module/Admin/Blocklist/Contact.php b/src/Module/Admin/Blocklist/Contact.php index bf1c7bc081..b0707fc70c 100644 --- a/src/Module/Admin/Blocklist/Contact.php +++ b/src/Module/Admin/Blocklist/Contact.php @@ -11,9 +11,9 @@ use Friendica\Model; class Contact extends BaseAdminModule { - public static function post() + public static function post($parameters) { - parent::post(); + parent::post($parameters); $contact_url = $_POST['contact_url'] ?? ''; $block_reason = $_POST['contact_block_reason'] ?? ''; @@ -41,9 +41,9 @@ class Contact extends BaseAdminModule self::getApp()->internalRedirect('admin/blocklist/contact'); } - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $a = self::getApp(); diff --git a/src/Module/Admin/Blocklist/Server.php b/src/Module/Admin/Blocklist/Server.php index 384e346b0d..a8c2fd812d 100644 --- a/src/Module/Admin/Blocklist/Server.php +++ b/src/Module/Admin/Blocklist/Server.php @@ -10,9 +10,9 @@ use Friendica\Util\Strings; class Server extends BaseAdminModule { - public static function post() + public static function post($parameters) { - parent::post(); + parent::post($parameters); if (empty($_POST['page_blocklist_save']) && empty($_POST['page_blocklist_edit'])) { return; @@ -50,9 +50,9 @@ class Server extends BaseAdminModule self::getApp()->internalRedirect('admin/blocklist/server'); } - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $a = self::getApp(); diff --git a/src/Module/Admin/DBSync.php b/src/Module/Admin/DBSync.php index 4c29eea34f..38c3970580 100644 --- a/src/Module/Admin/DBSync.php +++ b/src/Module/Admin/DBSync.php @@ -12,9 +12,9 @@ use Friendica\Module\BaseAdminModule; class DBSync extends BaseAdminModule { - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $a = self::getApp(); diff --git a/src/Module/Admin/Features.php b/src/Module/Admin/Features.php index 328e7e68b5..2523c4af13 100644 --- a/src/Module/Admin/Features.php +++ b/src/Module/Admin/Features.php @@ -10,9 +10,9 @@ use Friendica\Module\BaseAdminModule; class Features extends BaseAdminModule { - public static function post() + public static function post($parameters) { - parent::post(); + parent::post($parameters); parent::checkFormSecurityTokenRedirectOnError('/admin/features', 'admin_manage_features'); @@ -42,9 +42,9 @@ class Features extends BaseAdminModule self::getApp()->internalRedirect('admin/features'); } - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $arr = []; $features = Feature::get(false); diff --git a/src/Module/Admin/Federation.php b/src/Module/Admin/Federation.php index 8776f21e19..2bc15d8ae6 100644 --- a/src/Module/Admin/Federation.php +++ b/src/Module/Admin/Federation.php @@ -10,9 +10,9 @@ use Friendica\Module\BaseAdminModule; class Federation extends BaseAdminModule { - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); // get counts on active friendica, diaspora, redmatrix, hubzilla, gnu // social and statusnet nodes this node is knowing diff --git a/src/Module/Admin/Item/Delete.php b/src/Module/Admin/Item/Delete.php index 766e65c9a0..3616b3d2f6 100644 --- a/src/Module/Admin/Item/Delete.php +++ b/src/Module/Admin/Item/Delete.php @@ -10,9 +10,9 @@ use Friendica\Util\Strings; class Delete extends BaseAdminModule { - public static function post() + public static function post($parameters) { - parent::post(); + parent::post($parameters); if (empty($_POST['page_deleteitem_submit'])) { return; @@ -36,9 +36,9 @@ class Delete extends BaseAdminModule self::getApp()->internalRedirect('admin/item/delete'); } - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $t = Renderer::getMarkupTemplate('admin/item/delete.tpl'); diff --git a/src/Module/Admin/Item/Source.php b/src/Module/Admin/Item/Source.php index 6da9eec6d3..78953fd070 100644 --- a/src/Module/Admin/Item/Source.php +++ b/src/Module/Admin/Item/Source.php @@ -13,9 +13,9 @@ use Friendica\Module\BaseAdminModule; class Source extends BaseAdminModule { - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $a = self::getApp(); diff --git a/src/Module/Admin/Logs/Settings.php b/src/Module/Admin/Logs/Settings.php index be060e0535..b731dd0d6e 100644 --- a/src/Module/Admin/Logs/Settings.php +++ b/src/Module/Admin/Logs/Settings.php @@ -11,9 +11,9 @@ use Psr\Log\LogLevel; class Settings extends BaseAdminModule { - public static function post() + public static function post($parameters) { - parent::post(); + parent::post($parameters); if (!empty($_POST['page_logs'])) { parent::checkFormSecurityTokenRedirectOnError('/admin/logs', 'admin_logs'); @@ -37,9 +37,9 @@ class Settings extends BaseAdminModule self::getApp()->internalRedirect('admin/logs'); } - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $a = self::getApp(); diff --git a/src/Module/Admin/Logs/View.php b/src/Module/Admin/Logs/View.php index b66a6781e5..7feee32bef 100644 --- a/src/Module/Admin/Logs/View.php +++ b/src/Module/Admin/Logs/View.php @@ -10,9 +10,9 @@ use Friendica\Util\Strings; class View extends BaseAdminModule { - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $t = Renderer::getMarkupTemplate('admin/logs/view.tpl'); $f = Config::get('system', 'logfile'); diff --git a/src/Module/Admin/Queue.php b/src/Module/Admin/Queue.php index aadd5b768d..9b4241a8a8 100644 --- a/src/Module/Admin/Queue.php +++ b/src/Module/Admin/Queue.php @@ -19,9 +19,9 @@ use Friendica\Util\DateTimeFormat; */ class Queue extends BaseAdminModule { - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $a = self::getApp(); diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index 18a1cbf2a8..bfb4659aa8 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -21,9 +21,9 @@ require_once __DIR__ . '/../../../boot.php'; class Site extends BaseAdminModule { - public static function post() + public static function post($parameters) { - parent::post(); + parent::post($parameters); self::checkFormSecurityTokenRedirectOnError('/admin/site', 'admin_site'); @@ -412,9 +412,9 @@ class Site extends BaseAdminModule $a->internalRedirect('admin/site' . $active_panel); } - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $a = self::getApp(); diff --git a/src/Module/Admin/Summary.php b/src/Module/Admin/Summary.php index cfd9aa9840..24e1cc5845 100644 --- a/src/Module/Admin/Summary.php +++ b/src/Module/Admin/Summary.php @@ -20,9 +20,9 @@ use Friendica\Util\Network; class Summary extends BaseAdminModule { - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $a = self::getApp(); diff --git a/src/Module/Admin/Themes/Details.php b/src/Module/Admin/Themes/Details.php index 3750e96070..45f9239aa1 100644 --- a/src/Module/Admin/Themes/Details.php +++ b/src/Module/Admin/Themes/Details.php @@ -11,9 +11,9 @@ use Friendica\Util\Strings; class Details extends BaseAdminModule { - public static function post() + public static function post($parameters) { - parent::post(); + parent::post($parameters); $a = self::getApp(); @@ -39,9 +39,9 @@ class Details extends BaseAdminModule } } - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $a = self::getApp(); diff --git a/src/Module/Admin/Themes/Embed.php b/src/Module/Admin/Themes/Embed.php index 904d9eb46e..dc4b6f136e 100644 --- a/src/Module/Admin/Themes/Embed.php +++ b/src/Module/Admin/Themes/Embed.php @@ -9,7 +9,7 @@ use Friendica\Util\Strings; class Embed extends BaseAdminModule { - public static function init() + public static function init($parameters) { $a = self::getApp(); @@ -23,9 +23,9 @@ class Embed extends BaseAdminModule } } - public static function post() + public static function post($parameters) { - parent::post(); + parent::post($parameters); $a = self::getApp(); @@ -53,9 +53,9 @@ class Embed extends BaseAdminModule } } - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $a = self::getApp(); diff --git a/src/Module/Admin/Themes/Index.php b/src/Module/Admin/Themes/Index.php index af2d1f28e1..331f4c477d 100644 --- a/src/Module/Admin/Themes/Index.php +++ b/src/Module/Admin/Themes/Index.php @@ -11,9 +11,9 @@ use Friendica\Util\Strings; class Index extends BaseAdminModule { - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $a = self::getApp(); diff --git a/src/Module/Admin/Tos.php b/src/Module/Admin/Tos.php index 4eb6e3426c..3e6a25f465 100644 --- a/src/Module/Admin/Tos.php +++ b/src/Module/Admin/Tos.php @@ -9,9 +9,9 @@ use Friendica\Module\BaseAdminModule; class Tos extends BaseAdminModule { - public static function post() + public static function post($parameters) { - parent::post(); + parent::post($parameters); parent::checkFormSecurityTokenRedirectOnError('/admin/tos', 'admin_tos'); @@ -32,9 +32,9 @@ class Tos extends BaseAdminModule self::getApp()->internalRedirect('admin/tos'); } - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $tos = new \Friendica\Module\Tos(); $t = Renderer::getMarkupTemplate('admin/tos.tpl'); diff --git a/src/Module/Admin/Users.php b/src/Module/Admin/Users.php index a949c9331b..592b49495a 100644 --- a/src/Module/Admin/Users.php +++ b/src/Module/Admin/Users.php @@ -15,9 +15,9 @@ use Friendica\Util\Temporal; class Users extends BaseAdminModule { - public static function post() + public static function post($parameters) { - parent::post(); + parent::post($parameters); $a = self::getApp(); @@ -131,9 +131,9 @@ class Users extends BaseAdminModule $a->internalRedirect('admin/users'); } - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); $a = self::getApp(); diff --git a/src/Module/AllFriends.php b/src/Module/AllFriends.php index e5fbe69712..76453a02c3 100644 --- a/src/Module/AllFriends.php +++ b/src/Module/AllFriends.php @@ -16,7 +16,7 @@ use Friendica\Util\Proxy as ProxyUtils; */ class AllFriends extends BaseModule { - public static function content() + public static function content($parameters) { $app = self::getApp(); diff --git a/src/Module/Apps.php b/src/Module/Apps.php index efba071aa3..940bf6b641 100644 --- a/src/Module/Apps.php +++ b/src/Module/Apps.php @@ -13,7 +13,7 @@ use Friendica\Core\Renderer; */ class Apps extends BaseModule { - public static function init() + public static function init($parameters) { $privateaddons = Config::get('config', 'private_addons'); if ($privateaddons === "1" && !local_user()) { @@ -21,7 +21,7 @@ class Apps extends BaseModule } } - public static function content() + public static function content($parameters) { $apps = Nav::getAppMenu(); diff --git a/src/Module/BaseAdminModule.php b/src/Module/BaseAdminModule.php index 61b3b4ff9f..30c3766640 100644 --- a/src/Module/BaseAdminModule.php +++ b/src/Module/BaseAdminModule.php @@ -23,7 +23,7 @@ require_once 'boot.php'; */ abstract class BaseAdminModule extends BaseModule { - public static function post() + public static function post($parameters) { if (!is_site_admin()) { return; @@ -48,7 +48,7 @@ abstract class BaseAdminModule extends BaseModule return ''; } - public static function content() + public static function content($parameters) { $a = self::getApp(); diff --git a/src/Module/BaseSettingsModule.php b/src/Module/BaseSettingsModule.php index 4b5e9bf915..6a58ecfe40 100644 --- a/src/Module/BaseSettingsModule.php +++ b/src/Module/BaseSettingsModule.php @@ -9,7 +9,7 @@ use Friendica\Core\Renderer; class BaseSettingsModule extends BaseModule { - public static function content() + public static function content($parameters) { $a = self::getApp(); diff --git a/src/Module/Bookmarklet.php b/src/Module/Bookmarklet.php index 92130eeff1..2b0b198814 100644 --- a/src/Module/Bookmarklet.php +++ b/src/Module/Bookmarklet.php @@ -14,7 +14,7 @@ use Friendica\Util\Strings; */ class Bookmarklet extends BaseModule { - public static function content() + public static function content($parameters) { $_GET['mode'] = 'minimal'; diff --git a/src/Module/Contact.php b/src/Module/Contact.php index c8bbbfe2e6..2c5428e0b5 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -75,7 +75,7 @@ class Contact extends BaseModule $a->internalRedirect('contact'); } - public static function post() + public static function post($parameters) { $a = self::getApp(); diff --git a/src/Module/Credits.php b/src/Module/Credits.php index b0a6545c38..5abe1601ea 100644 --- a/src/Module/Credits.php +++ b/src/Module/Credits.php @@ -13,7 +13,7 @@ use Friendica\Core\Renderer; */ class Credits extends BaseModule { - public static function content() + public static function content($parameters) { /* fill the page with credits */ $credits_string = file_get_contents('CREDITS.txt'); diff --git a/src/Module/Debug/Babel.php b/src/Module/Debug/Babel.php index cf1f869552..e1a8b694bd 100644 --- a/src/Module/Debug/Babel.php +++ b/src/Module/Debug/Babel.php @@ -14,7 +14,7 @@ use Friendica\Util\XML; */ class Babel extends BaseModule { - public static function content() + public static function content($parameters) { function visible_whitespace($s) { diff --git a/src/Module/Debug/Feed.php b/src/Module/Debug/Feed.php index cc0be643b3..1583b3c882 100644 --- a/src/Module/Debug/Feed.php +++ b/src/Module/Debug/Feed.php @@ -14,7 +14,7 @@ use Friendica\Util\Network; */ class Feed extends BaseModule { - public static function init() + public static function init($parameters) { if (!local_user()) { info(L10n::t('You must be logged in to use this module')); @@ -22,7 +22,7 @@ class Feed extends BaseModule } } - public static function content() + public static function content($parameters) { $result = []; if (!empty($_REQUEST['url'])) { diff --git a/src/Module/Debug/ItemBody.php b/src/Module/Debug/ItemBody.php index fead255358..a2cf8df6bf 100644 --- a/src/Module/Debug/ItemBody.php +++ b/src/Module/Debug/ItemBody.php @@ -12,7 +12,7 @@ use Friendica\Network\HTTPException; */ class ItemBody extends BaseModule { - public static function content() + public static function content($parameters) { if (!local_user()) { throw new HTTPException\UnauthorizedException(L10n::t('Access denied.')); diff --git a/src/Module/Debug/Localtime.php b/src/Module/Debug/Localtime.php index 197149837a..8c3eac8b61 100644 --- a/src/Module/Debug/Localtime.php +++ b/src/Module/Debug/Localtime.php @@ -10,7 +10,7 @@ use Friendica\Util\Temporal; class Localtime extends BaseModule { - public static function post() + public static function post($parameters) { $time = ($_REQUEST['time'] ?? '') ?: 'now'; @@ -21,7 +21,7 @@ class Localtime extends BaseModule } } - public static function content() + public static function content($parameters) { $app = self::getApp(); diff --git a/src/Module/Debug/Probe.php b/src/Module/Debug/Probe.php index 6762c5b82c..a5785e1aa7 100644 --- a/src/Module/Debug/Probe.php +++ b/src/Module/Debug/Probe.php @@ -13,7 +13,7 @@ use Friendica\Network\Probe as NetworkProbe; */ class Probe extends BaseModule { - public static function content() + public static function content($parameters) { if (!local_user()) { $e = new HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.')); diff --git a/src/Module/Debug/WebFinger.php b/src/Module/Debug/WebFinger.php index 18cf4bb2a7..2b2ebacbf5 100644 --- a/src/Module/Debug/WebFinger.php +++ b/src/Module/Debug/WebFinger.php @@ -12,7 +12,7 @@ use Friendica\Network\Probe; */ class WebFinger extends BaseModule { - public static function content() + public static function content($parameters) { if (!local_user()) { $e = new \Friendica\Network\HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.')); diff --git a/src/Module/Delegation.php b/src/Module/Delegation.php index 77baefeaa5..46dc7025ee 100644 --- a/src/Module/Delegation.php +++ b/src/Module/Delegation.php @@ -17,7 +17,7 @@ use Friendica\Network\HTTPException\ForbiddenException; */ class Delegation extends BaseModule { - public static function post() + public static function post($parameters) { if (!local_user()) { return; @@ -92,7 +92,7 @@ class Delegation extends BaseModule // NOTREACHED } - public static function content() + public static function content($parameters) { if (!local_user()) { throw new ForbiddenException(L10n::t('Permission denied.')); diff --git a/src/Module/Diaspora/Receive.php b/src/Module/Diaspora/Receive.php index c787b5f970..d487ab63e5 100644 --- a/src/Module/Diaspora/Receive.php +++ b/src/Module/Diaspora/Receive.php @@ -21,13 +21,13 @@ class Receive extends BaseModule /** @var LoggerInterface */ private static $logger; - public static function init() + public static function init($parameters) { /** @var LoggerInterface $logger */ self::$logger = self::getClass(LoggerInterface::class); } - public static function post() + public static function post($parameters) { /** @var Configuration $config */ $config = self::getClass(Configuration::class); diff --git a/src/Module/Directory.php b/src/Module/Directory.php index 1cdd971e8a..c8523148ff 100644 --- a/src/Module/Directory.php +++ b/src/Module/Directory.php @@ -21,7 +21,7 @@ use Friendica\Util\Strings; */ class Directory extends BaseModule { - public static function content() + public static function content($parameters) { $app = self::getApp(); $config = $app->getConfig(); diff --git a/src/Module/Feed.php b/src/Module/Feed.php index 49ecfed96c..70974e61f1 100644 --- a/src/Module/Feed.php +++ b/src/Module/Feed.php @@ -23,7 +23,7 @@ use Friendica\Protocol\OStatus; */ class Feed extends BaseModule { - public static function content() + public static function content($parameters) { $a = self::getApp(); diff --git a/src/Module/Filer/RemoveTag.php b/src/Module/Filer/RemoveTag.php index 1dcc2e41e2..09284bec2e 100644 --- a/src/Module/Filer/RemoveTag.php +++ b/src/Module/Filer/RemoveTag.php @@ -12,7 +12,7 @@ use Friendica\Util\XML; */ class RemoveTag extends BaseModule { - public static function content() + public static function content($parameters) { if (!local_user()) { throw new HTTPException\ForbiddenException(); diff --git a/src/Module/Filer/SaveTag.php b/src/Module/Filer/SaveTag.php index 14eb368baa..1db3384ca5 100644 --- a/src/Module/Filer/SaveTag.php +++ b/src/Module/Filer/SaveTag.php @@ -14,7 +14,7 @@ use Friendica\Util\XML; */ class SaveTag extends BaseModule { - public static function init() + public static function init($parameters) { if (!local_user()) { info(L10n::t('You must be logged in to use this module')); diff --git a/src/Module/FollowConfirm.php b/src/Module/FollowConfirm.php index f4f2a877c4..66ca661856 100644 --- a/src/Module/FollowConfirm.php +++ b/src/Module/FollowConfirm.php @@ -18,7 +18,7 @@ use Friendica\Util\DateTimeFormat; */ class FollowConfirm extends BaseModule { - public static function post() + public static function post($parameters) { $a = self::getApp(); diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php index cadacb48b3..deb17b3859 100644 --- a/src/Module/Friendica.php +++ b/src/Module/Friendica.php @@ -15,7 +15,7 @@ use Friendica\Model\User; */ class Friendica extends BaseModule { - public static function content() + public static function content($parameters) { $app = self::getApp(); $config = $app->getConfig(); diff --git a/src/Module/Group.php b/src/Module/Group.php index d8d5fb1c59..6368690efd 100644 --- a/src/Module/Group.php +++ b/src/Module/Group.php @@ -19,7 +19,7 @@ require_once 'boot.php'; class Group extends BaseModule { - public static function post() + public static function post($parameters) { $a = self::getApp(); @@ -132,7 +132,7 @@ class Group extends BaseModule } } - public static function content() + public static function content($parameters) { $change = false; diff --git a/src/Module/HTTPException/MethodNotAllowed.php b/src/Module/HTTPException/MethodNotAllowed.php index 8d2d280a59..3e5d159e70 100644 --- a/src/Module/HTTPException/MethodNotAllowed.php +++ b/src/Module/HTTPException/MethodNotAllowed.php @@ -8,7 +8,7 @@ use Friendica\Network\HTTPException; class MethodNotAllowed extends BaseModule { - public static function content() + public static function content($parameters) { throw new HTTPException\MethodNotAllowedException(L10n::t('Method Not Allowed.')); } diff --git a/src/Module/HTTPException/PageNotFound.php b/src/Module/HTTPException/PageNotFound.php index d848905c5e..90192efca1 100644 --- a/src/Module/HTTPException/PageNotFound.php +++ b/src/Module/HTTPException/PageNotFound.php @@ -8,7 +8,7 @@ use Friendica\Network\HTTPException; class PageNotFound extends BaseModule { - public static function content() + public static function content($parameters) { throw new HTTPException\NotFoundException(L10n::t('Page not found.')); } diff --git a/src/Module/Hashtag.php b/src/Module/Hashtag.php index 411da5ce5e..8708a464a9 100644 --- a/src/Module/Hashtag.php +++ b/src/Module/Hashtag.php @@ -15,7 +15,7 @@ use Friendica\Util\Strings; class Hashtag extends BaseModule { - public static function content() + public static function content($parameters) { $result = []; diff --git a/src/Module/Help.php b/src/Module/Help.php index ddf5b06d83..ae5100d633 100644 --- a/src/Module/Help.php +++ b/src/Module/Help.php @@ -14,7 +14,7 @@ use Friendica\Util\Strings; */ class Help extends BaseModule { - public static function content() + public static function content($parameters) { Nav::setSelected('help'); diff --git a/src/Module/Home.php b/src/Module/Home.php index 5a1dccde2a..5e9c28af1d 100644 --- a/src/Module/Home.php +++ b/src/Module/Home.php @@ -12,7 +12,7 @@ use Friendica\Core\Renderer; */ class Home extends BaseModule { - public static function content() + public static function content($parameters) { $app = self::getApp(); $config = $app->getConfig(); diff --git a/src/Module/Install.php b/src/Module/Install.php index 39d6a062af..f4e2c4c76f 100644 --- a/src/Module/Install.php +++ b/src/Module/Install.php @@ -46,7 +46,7 @@ class Install extends BaseModule */ private static $installer; - public static function init() + public static function init($parameters) { $a = self::getApp(); @@ -76,7 +76,7 @@ class Install extends BaseModule self::$currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK; } - public static function post() + public static function post($parameters) { $a = self::getApp(); $configCache = $a->getConfigCache(); @@ -149,7 +149,7 @@ class Install extends BaseModule } } - public static function content() + public static function content($parameters) { $a = self::getApp(); $configCache = $a->getConfigCache(); diff --git a/src/Module/Invite.php b/src/Module/Invite.php index 7860c703c1..162d4489d7 100644 --- a/src/Module/Invite.php +++ b/src/Module/Invite.php @@ -16,7 +16,7 @@ use Friendica\Util\Strings; */ class Invite extends BaseModule { - public static function post() + public static function post($parameters) { if (!local_user()) { throw new HTTPException\ForbiddenException(L10n::t('Permission denied.')); @@ -104,7 +104,7 @@ class Invite extends BaseModule notice(L10n::tt('%d message sent.', '%d messages sent.', $total) . EOL); } - public static function content() + public static function content($parameters) { if (!local_user()) { throw new HTTPException\ForbiddenException(L10n::t('Permission denied.')); diff --git a/src/Module/Item/Compose.php b/src/Module/Item/Compose.php index c44e4c61ab..1a88ebbc58 100644 --- a/src/Module/Item/Compose.php +++ b/src/Module/Item/Compose.php @@ -21,7 +21,7 @@ use Friendica\Util\Crypto; class Compose extends BaseModule { - public static function post() + public static function post($parameters) { if (!empty($_REQUEST['body'])) { $_REQUEST['return'] = 'network'; @@ -32,7 +32,7 @@ class Compose extends BaseModule } } - public static function content() + public static function content($parameters) { if (!local_user()) { return Login::form('compose', false); diff --git a/src/Module/Login.php b/src/Module/Login.php index 0048fefaae..4cdac27aea 100644 --- a/src/Module/Login.php +++ b/src/Module/Login.php @@ -30,7 +30,7 @@ use LightOpenID; */ class Login extends BaseModule { - public static function content() + public static function content($parameters) { $a = self::getApp(); @@ -41,7 +41,7 @@ class Login extends BaseModule return self::form(Session::get('return_path'), intval(Config::get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED); } - public static function post() + public static function post($parameters) { $openid_identity = Session::get('openid_identity'); $openid_server = Session::get('openid_server'); diff --git a/src/Module/Logout.php b/src/Module/Logout.php index bf6a39e19f..ad7eac6b51 100644 --- a/src/Module/Logout.php +++ b/src/Module/Logout.php @@ -23,7 +23,7 @@ class Logout extends BaseModule /** * @brief Process logout requests */ - public static function init() + public static function init($parameters) { $visitor_home = null; if (remote_user()) { diff --git a/src/Module/Magic.php b/src/Module/Magic.php index b04ea80c04..43c17d7259 100644 --- a/src/Module/Magic.php +++ b/src/Module/Magic.php @@ -20,7 +20,7 @@ use Friendica\Util\Strings; */ class Magic extends BaseModule { - public static function init() + public static function init($parameters) { $a = self::getApp(); $ret = ['success' => false, 'url' => '', 'message' => '']; diff --git a/src/Module/Maintenance.php b/src/Module/Maintenance.php index 24140bb351..0a7b67cf80 100644 --- a/src/Module/Maintenance.php +++ b/src/Module/Maintenance.php @@ -14,7 +14,7 @@ use Friendica\Util\Strings; */ class Maintenance extends BaseModule { - public static function content() + public static function content($parameters) { $config = self::getApp()->getConfig(); diff --git a/src/Module/NodeInfo.php b/src/Module/NodeInfo.php index f4ecc5da68..22e26e97a4 100644 --- a/src/Module/NodeInfo.php +++ b/src/Module/NodeInfo.php @@ -13,7 +13,7 @@ use Friendica\Core\System; */ class NodeInfo extends BaseModule { - public static function init() + public static function init($parameters) { $config = self::getApp()->getConfig(); diff --git a/src/Module/Notifications/Notify.php b/src/Module/Notifications/Notify.php index 360204d94b..28047c6989 100644 --- a/src/Module/Notifications/Notify.php +++ b/src/Module/Notifications/Notify.php @@ -14,7 +14,7 @@ use Friendica\Network\HTTPException; */ class Notify extends BaseModule { - public static function init() + public static function init($parameters) { if (!local_user()) { throw new HTTPException\UnauthorizedException(L10n::t('Permission denied.')); @@ -45,7 +45,7 @@ class Notify extends BaseModule * @return string|void * @throws HTTPException\InternalServerErrorException */ - public static function content() + public static function content($parameters) { $a = self::getApp(); diff --git a/src/Module/Oembed.php b/src/Module/Oembed.php index 0107782122..e31fde6313 100644 --- a/src/Module/Oembed.php +++ b/src/Module/Oembed.php @@ -17,7 +17,7 @@ use Friendica\Util\Strings; */ class Oembed extends BaseModule { - public static function content() + public static function content($parameters) { $a = self::getApp(); diff --git a/src/Module/Owa.php b/src/Module/Owa.php index 7243c11134..a8c980373d 100644 --- a/src/Module/Owa.php +++ b/src/Module/Owa.php @@ -27,7 +27,7 @@ use Friendica\Util\Strings; */ class Owa extends BaseModule { - public static function init() + public static function init($parameters) { $ret = [ 'success' => false ]; diff --git a/src/Module/Photo.php b/src/Module/Photo.php index 4ec4f204c3..58199a08da 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -23,7 +23,7 @@ class Photo extends BaseModule * Fetch a photo or an avatar, in optional size, check for permissions and * return the image */ - public static function init() + public static function init($parameters) { $a = self::getApp(); // @TODO: Replace with parameter from router diff --git a/src/Module/Profile.php b/src/Module/Profile.php index ab2fad2e2f..527c7118e9 100644 --- a/src/Module/Profile.php +++ b/src/Module/Profile.php @@ -33,7 +33,7 @@ class Profile extends BaseModule public static $which = ''; public static $profile = 0; - public static function init() + public static function init($parameters) { $a = self::getApp(); diff --git a/src/Module/Profile/Contacts.php b/src/Module/Profile/Contacts.php index 1bf88d7c5b..3df256b9d5 100644 --- a/src/Module/Profile/Contacts.php +++ b/src/Module/Profile/Contacts.php @@ -18,7 +18,7 @@ use Friendica\Util\Proxy as ProxyUtils; class Contacts extends BaseModule { - public static function content() + public static function content($parameters) { if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { throw new \Friendica\Network\HTTPException\NotFoundException(L10n::t('User not found.')); diff --git a/src/Module/Proxy.php b/src/Module/Proxy.php index 2b8ad01dda..17509f662d 100644 --- a/src/Module/Proxy.php +++ b/src/Module/Proxy.php @@ -30,7 +30,7 @@ class Proxy extends BaseModule * Sets application instance and checks if /proxy/ path is writable. * */ - public static function init() + public static function init($parameters) { // Set application instance here $a = self::getApp(); diff --git a/src/Module/RandomProfile.php b/src/Module/RandomProfile.php index 3ecaa54b76..8edc43bf0c 100644 --- a/src/Module/RandomProfile.php +++ b/src/Module/RandomProfile.php @@ -11,7 +11,7 @@ use Friendica\Model\GContact; */ class RandomProfile extends BaseModule { - public static function content() + public static function content($parameters) { $a = self::getApp(); diff --git a/src/Module/Register.php b/src/Module/Register.php index 0837b5706e..6993415e66 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -35,7 +35,7 @@ class Register extends BaseModule * * @return string */ - public static function content() + public static function content($parameters) { // logged in users can register others (people/pages/groups) // even with closed registrations, unless specifically prohibited by site policy. @@ -152,7 +152,7 @@ class Register extends BaseModule * Extend this method if the module is supposed to process POST requests. * Doesn't display any content */ - public static function post() + public static function post($parameters) { BaseModule::checkFormSecurityTokenRedirectOnError('/register', 'register'); diff --git a/src/Module/Search/Directory.php b/src/Module/Search/Directory.php index 405fb0cc82..c6734ac87c 100644 --- a/src/Module/Search/Directory.php +++ b/src/Module/Search/Directory.php @@ -13,7 +13,7 @@ use Friendica\Util\Strings; */ class Directory extends BaseSearchModule { - public static function content() + public static function content($parameters) { if (!local_user()) { notice(L10n::t('Permission denied.')); diff --git a/src/Module/Search/Index.php b/src/Module/Search/Index.php index 73de090a71..6f0f21f62a 100644 --- a/src/Module/Search/Index.php +++ b/src/Module/Search/Index.php @@ -23,7 +23,7 @@ use Friendica\Util\Strings; class Index extends BaseSearchModule { - public static function content() + public static function content($parameters) { $search = (!empty($_GET['q']) ? Strings::escapeTags(trim(rawurldecode($_GET['q']))) : ''); diff --git a/src/Module/Search/Saved.php b/src/Module/Search/Saved.php index 9d8d84b55a..42429c47bd 100644 --- a/src/Module/Search/Saved.php +++ b/src/Module/Search/Saved.php @@ -10,7 +10,7 @@ use Friendica\Util\Strings; class Saved extends BaseModule { - public static function init() + public static function init($parameters) { /** @var Arguments $args */ $args = self::getClass(Arguments::class); diff --git a/src/Module/Settings/Delegation.php b/src/Module/Settings/Delegation.php index f7edc72c94..8048d3bf8f 100644 --- a/src/Module/Settings/Delegation.php +++ b/src/Module/Settings/Delegation.php @@ -20,7 +20,7 @@ use Friendica\Util\Strings; */ class Delegation extends BaseSettingsModule { - public static function post() + public static function post($parameters) { if (!local_user() || !empty(self::getApp()->user['uid']) && self::getApp()->user['uid'] != local_user()) { throw new HTTPException\ForbiddenException(L10n::t('Permission denied.')); @@ -46,9 +46,9 @@ class Delegation extends BaseSettingsModule DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => local_user()]); } - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); if (!local_user()) { throw new HTTPException\ForbiddenException(L10n::t('Permission denied.')); diff --git a/src/Module/Settings/TwoFactor/AppSpecific.php b/src/Module/Settings/TwoFactor/AppSpecific.php index c62b0bbff0..720fb9a831 100644 --- a/src/Module/Settings/TwoFactor/AppSpecific.php +++ b/src/Module/Settings/TwoFactor/AppSpecific.php @@ -20,7 +20,7 @@ class AppSpecific extends BaseSettingsModule { private static $appSpecificPassword = null; - public static function init() + public static function init($parameters) { if (!local_user()) { return; @@ -38,7 +38,7 @@ class AppSpecific extends BaseSettingsModule } } - public static function post() + public static function post($parameters) { if (!local_user()) { return; @@ -81,13 +81,13 @@ class AppSpecific extends BaseSettingsModule } } - public static function content() + public static function content($parameters) { if (!local_user()) { return Login::form('settings/2fa/app_specific'); } - parent::content(); + parent::content($parameters); $appSpecificPasswords = AppSpecificPassword::getListForUser(local_user()); diff --git a/src/Module/Settings/TwoFactor/Index.php b/src/Module/Settings/TwoFactor/Index.php index e7694225c4..9a661ef731 100644 --- a/src/Module/Settings/TwoFactor/Index.php +++ b/src/Module/Settings/TwoFactor/Index.php @@ -17,7 +17,7 @@ use PragmaRX\Google2FA\Google2FA; class Index extends BaseSettingsModule { - public static function post() + public static function post($parameters) { if (!local_user()) { return; @@ -73,13 +73,13 @@ class Index extends BaseSettingsModule } } - public static function content() + public static function content($parameters) { if (!local_user()) { return Login::form('settings/2fa'); } - parent::content(); + parent::content($parameters); $has_secret = (bool) PConfig::get(local_user(), '2fa', 'secret'); $verified = PConfig::get(local_user(), '2fa', 'verified'); diff --git a/src/Module/Settings/TwoFactor/Recovery.php b/src/Module/Settings/TwoFactor/Recovery.php index 6937fa503f..b3155f6e9e 100644 --- a/src/Module/Settings/TwoFactor/Recovery.php +++ b/src/Module/Settings/TwoFactor/Recovery.php @@ -18,7 +18,7 @@ use Friendica\Module\Login; */ class Recovery extends BaseSettingsModule { - public static function init() + public static function init($parameters) { if (!local_user()) { return; @@ -36,7 +36,7 @@ class Recovery extends BaseSettingsModule } } - public static function post() + public static function post($parameters) { if (!local_user()) { return; @@ -53,13 +53,13 @@ class Recovery extends BaseSettingsModule } } - public static function content() + public static function content($parameters) { if (!local_user()) { return Login::form('settings/2fa/recovery'); } - parent::content(); + parent::content($parameters); if (!RecoveryCode::countValidForUser(local_user())) { RecoveryCode::generateForUser(local_user()); diff --git a/src/Module/Settings/TwoFactor/Verify.php b/src/Module/Settings/TwoFactor/Verify.php index b9205852d8..3957a5350a 100644 --- a/src/Module/Settings/TwoFactor/Verify.php +++ b/src/Module/Settings/TwoFactor/Verify.php @@ -24,7 +24,7 @@ use PragmaRX\Google2FA\Google2FA; */ class Verify extends BaseSettingsModule { - public static function init() + public static function init($parameters) { if (!local_user()) { return; @@ -43,7 +43,7 @@ class Verify extends BaseSettingsModule } } - public static function post() + public static function post($parameters) { if (!local_user()) { return; @@ -69,13 +69,13 @@ class Verify extends BaseSettingsModule } } - public static function content() + public static function content($parameters) { if (!local_user()) { return Login::form('settings/2fa/verify'); } - parent::content(); + parent::content($parameters); $company = 'Friendica'; $holder = Session::get('my_address'); diff --git a/src/Module/Settings/UserExport.php b/src/Module/Settings/UserExport.php index 9c4e4913cf..c571be2505 100644 --- a/src/Module/Settings/UserExport.php +++ b/src/Module/Settings/UserExport.php @@ -32,9 +32,9 @@ class UserExport extends BaseSettingsModule * If there is an action required through the URL / path, react * accordingly and export the requested data. **/ - public static function content() + public static function content($parameters) { - parent::content(); + parent::content($parameters); /** * options shown on "Export personal data" page diff --git a/src/Module/Smilies.php b/src/Module/Smilies.php index 9a81a888e9..a2b91f54de 100644 --- a/src/Module/Smilies.php +++ b/src/Module/Smilies.php @@ -26,7 +26,7 @@ class Smilies extends BaseModule } } - public static function content() + public static function content($parameters) { $smilies = Content\Smilies::getList(); $count = count($smilies['texts'] ?? []); diff --git a/src/Module/Starred.php b/src/Module/Starred.php index 5c79c4fac8..1aab10307d 100644 --- a/src/Module/Starred.php +++ b/src/Module/Starred.php @@ -4,7 +4,6 @@ namespace Friendica\Module; use Friendica\BaseModule; use Friendica\Model\Item; -use Friendica\Core\System; /** * Toggle starred items @@ -28,7 +27,7 @@ class Starred extends BaseModule exit(); } - $starred = !$item['starred']; + $starred = !(bool)$item['starred']; Item::update(['starred' => $starred], ['id' => $itemId]); @@ -40,6 +39,7 @@ class Starred extends BaseModule } // the json doesn't really matter, it will either be 0 or 1 - System::jsonExit($starred); + echo json_encode((int)$starred); + exit(); } } diff --git a/src/Module/Statistics.php b/src/Module/Statistics.php index 7400943237..53f9acf95f 100644 --- a/src/Module/Statistics.php +++ b/src/Module/Statistics.php @@ -8,7 +8,7 @@ use Friendica\Core\System; class Statistics extends BaseModule { - public static function init() + public static function init($parameters) { $config = self::getApp()->getConfig(); diff --git a/src/Module/ToggleMobile.php b/src/Module/ToggleMobile.php index 9788c0b5db..07e6fd87d1 100644 --- a/src/Module/ToggleMobile.php +++ b/src/Module/ToggleMobile.php @@ -9,7 +9,7 @@ use Friendica\BaseModule; */ class ToggleMobile extends BaseModule { - public static function content() + public static function content($parameters) { $a = self::getApp(); diff --git a/src/Module/Tos.php b/src/Module/Tos.php index c26085b48b..c69557d5dc 100644 --- a/src/Module/Tos.php +++ b/src/Module/Tos.php @@ -47,7 +47,7 @@ class Tos extends BaseModule * dealings with their own node so a TOS is not necessary. * **/ - public static function init() + public static function init($parameters) { if (strlen(Config::get('system','singleuser'))) { self::getApp()->internalRedirect('profile/' . Config::get('system','singleuser')); @@ -66,7 +66,7 @@ class Tos extends BaseModule * @return string * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function content() { + public static function content($parameters) { $tpl = Renderer::getMarkupTemplate('tos.tpl'); if (Config::get('system', 'tosdisplay')) { return Renderer::replaceMacros($tpl, [ diff --git a/src/Module/TwoFactor/Recovery.php b/src/Module/TwoFactor/Recovery.php index 7c17fdace0..82cfc80eac 100644 --- a/src/Module/TwoFactor/Recovery.php +++ b/src/Module/TwoFactor/Recovery.php @@ -15,14 +15,14 @@ use Friendica\Model\TwoFactor\RecoveryCode; */ class Recovery extends BaseModule { - public static function init() + public static function init($parameters) { if (!local_user()) { return; } } - public static function post() + public static function post($parameters) { if (!local_user()) { return; @@ -48,7 +48,7 @@ class Recovery extends BaseModule } } - public static function content() + public static function content($parameters) { if (!local_user()) { self::getApp()->internalRedirect(); diff --git a/src/Module/TwoFactor/Verify.php b/src/Module/TwoFactor/Verify.php index 4b1c974d8f..daef9f60a5 100644 --- a/src/Module/TwoFactor/Verify.php +++ b/src/Module/TwoFactor/Verify.php @@ -18,7 +18,7 @@ class Verify extends BaseModule { private static $errors = []; - public static function post() + public static function post($parameters) { if (!local_user()) { return; @@ -45,7 +45,7 @@ class Verify extends BaseModule } } - public static function content() + public static function content($parameters) { if (!local_user()) { self::getApp()->internalRedirect(); diff --git a/src/Module/Welcome.php b/src/Module/Welcome.php index 9e1eace9b6..d92f4109ce 100644 --- a/src/Module/Welcome.php +++ b/src/Module/Welcome.php @@ -11,7 +11,7 @@ use Friendica\Core\Renderer; */ class Welcome extends BaseModule { - public static function content() + public static function content($parameters) { $config = self::getApp()->getConfig(); From bc2694bf7f9d4e36e92376c6263c3471569bd4d8 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Nov 2019 20:28:35 +0000 Subject: [PATCH 04/10] Redo some changes --- src/Module/Pinned.php | 60 ----------------------------------- static/dbstructure.config.php | 5 ++- static/routes.config.php | 5 ++- 3 files changed, 4 insertions(+), 66 deletions(-) delete mode 100644 src/Module/Pinned.php diff --git a/src/Module/Pinned.php b/src/Module/Pinned.php deleted file mode 100644 index 590bda159e..0000000000 --- a/src/Module/Pinned.php +++ /dev/null @@ -1,60 +0,0 @@ -argc > 1) { - $itemId = intval($a->argv[1]); - } - - if (!$itemId) { - exit(); - } - - $item = Item::selectFirstForUser(local_user(), ['pinned'], ['uid' => local_user(), 'id' => $itemId]); - if (empty($item)) { - exit(); - } - - if (!intval($item['pinned'])) { - $pinned = 1; - } - - Item::update(['pinned' => $pinned], ['id' => $itemId]); - - // See if we've been passed a return path to redirect to - $returnPath = $_REQUEST['return'] ?? ''; - if ($returnPath) { - $rand = '_=' . time(); - if (strpos($returnPath, '?')) { - $rand = "&$rand"; - } else { - $rand = "?$rand"; - } - - $a->internalRedirect($returnPath . $rand); - } - - // the json doesn't really matter, it will either be 0 or 1 - echo json_encode($pinned); - exit(); - } -} diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 65e0b26a6a..53f8a8ed44 100755 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -34,7 +34,7 @@ use Friendica\Database\DBA; if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1324); + define('DB_UPDATE_VERSION', 1323); } return [ @@ -1384,8 +1384,7 @@ return [ "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"], "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"], "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"], - "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"], - "pinned" => ["type" => "boolean", "comment" => "The item is pinned on the profile page"] + "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"] ], "indexes" => [ "PRIMARY" => ["uid", "iid"] diff --git a/static/routes.config.php b/static/routes.config.php index 339860afe6..1f2fe0ad1b 100644 --- a/static/routes.config.php +++ b/static/routes.config.php @@ -179,9 +179,8 @@ return [ '/{type}/{customize}/{name}' => [Module\Photo::class, [R::GET]], ], - '/pinned/{item:\d+}' => [Module\Pinned::class, [R::GET]], - '/pretheme' => [Module\ThemeDetails::class, [R::GET]], - '/probe' => [Module\Debug\Probe::class, [R::GET]], + '/pretheme' => [Module\ThemeDetails::class, [R::GET]], + '/probe' => [Module\Debug\Probe::class, [R::GET]], '/profile' => [ '/{nickname}' => [Module\Profile::class, [R::GET]], From 8c03bdada92845974ecadeecb9e673c7ffac22b4 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Nov 2019 21:48:54 +0000 Subject: [PATCH 05/10] parameters now are having a default value and are optional --- mod/update_contact.php | 2 +- mod/update_profile.php | 2 +- src/BaseModule.php | 10 +- src/LegacyModule.php | 10 +- .../AccountManagementControlDocument.php | 2 +- src/Module/Acctlink.php | 2 +- src/Module/Admin/Addons/Details.php | 4 +- src/Module/Admin/Addons/Index.php | 2 +- src/Module/Admin/Blocklist/Contact.php | 4 +- src/Module/Admin/Blocklist/Server.php | 4 +- src/Module/Admin/DBSync.php | 2 +- src/Module/Admin/Features.php | 4 +- src/Module/Admin/Federation.php | 2 +- src/Module/Admin/Item/Delete.php | 4 +- src/Module/Admin/Item/Source.php | 2 +- src/Module/Admin/Logs/Settings.php | 4 +- src/Module/Admin/Logs/View.php | 2 +- src/Module/Admin/PhpInfo.php | 2 +- src/Module/Admin/Queue.php | 2 +- src/Module/Admin/Site.php | 4 +- src/Module/Admin/Summary.php | 2 +- src/Module/Admin/Themes/Details.php | 4 +- src/Module/Admin/Themes/Embed.php | 6 +- src/Module/Admin/Themes/Index.php | 2 +- src/Module/Admin/Tos.php | 4 +- src/Module/Admin/Users.php | 4 +- src/Module/AllFriends.php | 2 +- src/Module/Apps.php | 4 +- src/Module/Attach.php | 2 +- src/Module/BaseAdminModule.php | 6 +- src/Module/BaseSettingsModule.php | 2 +- src/Module/Bookmarklet.php | 2 +- src/Module/Contact.php | 4 +- src/Module/Contact/Hovercard.php | 2 +- src/Module/Credits.php | 2 +- src/Module/Debug/Babel.php | 2 +- src/Module/Debug/Feed.php | 4 +- src/Module/Debug/ItemBody.php | 2 +- src/Module/Debug/Localtime.php | 4 +- src/Module/Debug/Probe.php | 2 +- src/Module/Debug/WebFinger.php | 2 +- src/Module/Delegation.php | 4 +- src/Module/Diaspora/Fetch.php | 2 +- src/Module/Diaspora/Receive.php | 4 +- src/Module/Directory.php | 2 +- src/Module/Feed.php | 2 +- src/Module/Filer/RemoveTag.php | 2 +- src/Module/Filer/SaveTag.php | 4 +- src/Module/FollowConfirm.php | 2 +- src/Module/Followers.php | 2 +- src/Module/Following.php | 2 +- src/Module/Friendica.php | 4 +- src/Module/Group.php | 4 +- src/Module/HTTPException/MethodNotAllowed.php | 2 +- src/Module/HTTPException/PageNotFound.php | 2 +- src/Module/Hashtag.php | 2 +- src/Module/Help.php | 2 +- src/Module/Home.php | 2 +- src/Module/Inbox.php | 2 +- src/Module/Install.php | 6 +- src/Module/Invite.php | 4 +- src/Module/Item/Compose.php | 4 +- src/Module/Item/Ignore.php | 2 +- src/Module/Like.php | 2 +- src/Module/Login.php | 4 +- src/Module/Logout.php | 2 +- src/Module/Magic.php | 2 +- src/Module/Maintenance.php | 2 +- src/Module/Manifest.php | 2 +- src/Module/NodeInfo.php | 4 +- src/Module/Notifications/Notify.php | 6 +- src/Module/Objects.php | 2 +- src/Module/Oembed.php | 2 +- src/Module/OpenSearch.php | 2 +- src/Module/Outbox.php | 2 +- src/Module/Owa.php | 2 +- src/Module/Photo.php | 2 +- src/Module/Profile.php | 6 +- src/Module/Profile/Contacts.php | 2 +- src/Module/Proxy.php | 2 +- src/Module/PublicRSAKey.php | 2 +- src/Module/RandomProfile.php | 2 +- src/Module/ReallySimpleDiscovery.php | 2 +- src/Module/Register.php | 4 +- src/Module/RobotsTxt.php | 2 +- src/Module/Search/Acl.php | 2 +- src/Module/Search/Directory.php | 2 +- src/Module/Search/Index.php | 2 +- src/Module/Search/Saved.php | 2 +- src/Module/Settings/Delegation.php | 4 +- src/Module/Settings/TwoFactor/AppSpecific.php | 6 +- src/Module/Settings/TwoFactor/Index.php | 4 +- src/Module/Settings/TwoFactor/Recovery.php | 6 +- src/Module/Settings/TwoFactor/Verify.php | 6 +- src/Module/Settings/UserExport.php | 4 +- src/Module/Smilies.php | 4 +- src/Module/Starred.php | 2 +- src/Module/Statistics.php | 4 +- src/Module/Theme.php | 2 +- src/Module/ThemeDetails.php | 2 +- src/Module/ToggleMobile.php | 2 +- src/Module/Tos.php | 4 +- src/Module/TwoFactor/Recovery.php | 6 +- src/Module/TwoFactor/Verify.php | 4 +- src/Module/Welcome.php | 2 +- src/Module/WellKnown/HostMeta.php | 2 +- src/Module/WellKnown/XSocialRelay.php | 2 +- src/Module/Xrd.php | 2 +- static/dbstructure.config.php.sic | 1439 +++++++++++++++++ static/routes.config.php.sic | 236 +++ 110 files changed, 1840 insertions(+), 165 deletions(-) create mode 100755 static/dbstructure.config.php.sic create mode 100644 static/routes.config.php.sic diff --git a/mod/update_contact.php b/mod/update_contact.php index 1f96dab25b..bea33b4841 100644 --- a/mod/update_contact.php +++ b/mod/update_contact.php @@ -14,7 +14,7 @@ function update_contact_content(App $a) echo "
"; if ($_GET["force"] == 1) { - $text = Contact::content(true); + $text = Contact::content([], true); } else { $text = ''; } diff --git a/mod/update_profile.php b/mod/update_profile.php index 7205670395..85ca3d3c97 100644 --- a/mod/update_profile.php +++ b/mod/update_profile.php @@ -28,7 +28,7 @@ function update_profile_content(App $a) { * on the client side and then swap the image back. */ - $text = Profile::content($profile_uid); + $text = Profile::content([], $profile_uid); if (PConfig::get(local_user(), "system", "bandwidth_saver")) { $replace = "
".L10n::t("[Embedded content - reload page to view]")."
"; diff --git a/src/BaseModule.php b/src/BaseModule.php index 3bc2ac9ff2..2b9ebdb14e 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -22,7 +22,7 @@ abstract class BaseModule extends BaseObject * Extend this method if you need to do any shared processing before both * content() or post() */ - public static function init($parameters) + public static function init(array $parameters = []) { } @@ -32,7 +32,7 @@ abstract class BaseModule extends BaseObject * Extend this method if the module is supposed to return communication data, * e.g. from protocol implementations. */ - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { } @@ -45,7 +45,7 @@ abstract class BaseModule extends BaseObject * * @return string */ - public static function content($parameters) + public static function content(array $parameters = []) { $o = ''; @@ -58,7 +58,7 @@ abstract class BaseModule extends BaseObject * Extend this method if the module is supposed to process POST requests. * Doesn't display any content */ - public static function post($parameters) + public static function post(array $parameters = []) { } @@ -67,7 +67,7 @@ abstract class BaseModule extends BaseObject * * Unknown purpose */ - public static function afterpost($parameters) + public static function afterpost(array $parameters = []) { } diff --git a/src/LegacyModule.php b/src/LegacyModule.php index 7252e7bef3..950f8faad2 100644 --- a/src/LegacyModule.php +++ b/src/LegacyModule.php @@ -35,22 +35,22 @@ class LegacyModule extends BaseModule require_once $file_path; } - public static function init($parameters) + public static function init(array $parameters = []) { self::runModuleFunction('init', $parameters); } - public static function content($parameters) + public static function content(array $parameters = []) { return self::runModuleFunction('content', $parameters); } - public static function post($parameters) + public static function post(array $parameters = []) { self::runModuleFunction('post', $parameters); } - public static function afterpost($parameters) + public static function afterpost(array $parameters = []) { self::runModuleFunction('afterpost', $parameters); } @@ -62,7 +62,7 @@ class LegacyModule extends BaseModule * @return string * @throws \Exception */ - private static function runModuleFunction($function_suffix, $parameters) + private static function runModuleFunction($function_suffix, array $parameters = []) { $function_name = static::$moduleName . '_' . $function_suffix; diff --git a/src/Module/AccountManagementControlDocument.php b/src/Module/AccountManagementControlDocument.php index 0cf1de6f15..8e7ee0243a 100644 --- a/src/Module/AccountManagementControlDocument.php +++ b/src/Module/AccountManagementControlDocument.php @@ -11,7 +11,7 @@ use Friendica\BaseModule; */ class AccountManagementControlDocument extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $output = [ 'version' => 1, diff --git a/src/Module/Acctlink.php b/src/Module/Acctlink.php index bef407eb1c..a3577da320 100644 --- a/src/Module/Acctlink.php +++ b/src/Module/Acctlink.php @@ -11,7 +11,7 @@ use Friendica\Core\System; */ class Acctlink extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $addr = trim($_GET['addr'] ?? ''); diff --git a/src/Module/Admin/Addons/Details.php b/src/Module/Admin/Addons/Details.php index 7508cdbf69..a196e7834f 100644 --- a/src/Module/Admin/Addons/Details.php +++ b/src/Module/Admin/Addons/Details.php @@ -11,7 +11,7 @@ use Friendica\Util\Strings; class Details extends BaseAdminModule { - public static function post($parameters) + public static function post(array $parameters = []) { parent::post($parameters); @@ -35,7 +35,7 @@ class Details extends BaseAdminModule $a->internalRedirect('admin/addons'); } - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Addons/Index.php b/src/Module/Admin/Addons/Index.php index 645bd431e3..f327f0dc92 100644 --- a/src/Module/Admin/Addons/Index.php +++ b/src/Module/Admin/Addons/Index.php @@ -9,7 +9,7 @@ use Friendica\Module\BaseAdminModule; class Index extends BaseAdminModule { - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Blocklist/Contact.php b/src/Module/Admin/Blocklist/Contact.php index b0707fc70c..38ae233715 100644 --- a/src/Module/Admin/Blocklist/Contact.php +++ b/src/Module/Admin/Blocklist/Contact.php @@ -11,7 +11,7 @@ use Friendica\Model; class Contact extends BaseAdminModule { - public static function post($parameters) + public static function post(array $parameters = []) { parent::post($parameters); @@ -41,7 +41,7 @@ class Contact extends BaseAdminModule self::getApp()->internalRedirect('admin/blocklist/contact'); } - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Blocklist/Server.php b/src/Module/Admin/Blocklist/Server.php index a8c2fd812d..53647e64ef 100644 --- a/src/Module/Admin/Blocklist/Server.php +++ b/src/Module/Admin/Blocklist/Server.php @@ -10,7 +10,7 @@ use Friendica\Util\Strings; class Server extends BaseAdminModule { - public static function post($parameters) + public static function post(array $parameters = []) { parent::post($parameters); @@ -50,7 +50,7 @@ class Server extends BaseAdminModule self::getApp()->internalRedirect('admin/blocklist/server'); } - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/DBSync.php b/src/Module/Admin/DBSync.php index 38c3970580..0d68a56481 100644 --- a/src/Module/Admin/DBSync.php +++ b/src/Module/Admin/DBSync.php @@ -12,7 +12,7 @@ use Friendica\Module\BaseAdminModule; class DBSync extends BaseAdminModule { - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Features.php b/src/Module/Admin/Features.php index 2523c4af13..85683d238f 100644 --- a/src/Module/Admin/Features.php +++ b/src/Module/Admin/Features.php @@ -10,7 +10,7 @@ use Friendica\Module\BaseAdminModule; class Features extends BaseAdminModule { - public static function post($parameters) + public static function post(array $parameters = []) { parent::post($parameters); @@ -42,7 +42,7 @@ class Features extends BaseAdminModule self::getApp()->internalRedirect('admin/features'); } - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Federation.php b/src/Module/Admin/Federation.php index 2bc15d8ae6..35afb21448 100644 --- a/src/Module/Admin/Federation.php +++ b/src/Module/Admin/Federation.php @@ -10,7 +10,7 @@ use Friendica\Module\BaseAdminModule; class Federation extends BaseAdminModule { - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Item/Delete.php b/src/Module/Admin/Item/Delete.php index 3616b3d2f6..f5f4687cec 100644 --- a/src/Module/Admin/Item/Delete.php +++ b/src/Module/Admin/Item/Delete.php @@ -10,7 +10,7 @@ use Friendica\Util\Strings; class Delete extends BaseAdminModule { - public static function post($parameters) + public static function post(array $parameters = []) { parent::post($parameters); @@ -36,7 +36,7 @@ class Delete extends BaseAdminModule self::getApp()->internalRedirect('admin/item/delete'); } - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Item/Source.php b/src/Module/Admin/Item/Source.php index 78953fd070..9c41e60f47 100644 --- a/src/Module/Admin/Item/Source.php +++ b/src/Module/Admin/Item/Source.php @@ -13,7 +13,7 @@ use Friendica\Module\BaseAdminModule; class Source extends BaseAdminModule { - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Logs/Settings.php b/src/Module/Admin/Logs/Settings.php index b731dd0d6e..42f3435f65 100644 --- a/src/Module/Admin/Logs/Settings.php +++ b/src/Module/Admin/Logs/Settings.php @@ -11,7 +11,7 @@ use Psr\Log\LogLevel; class Settings extends BaseAdminModule { - public static function post($parameters) + public static function post(array $parameters = []) { parent::post($parameters); @@ -37,7 +37,7 @@ class Settings extends BaseAdminModule self::getApp()->internalRedirect('admin/logs'); } - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Logs/View.php b/src/Module/Admin/Logs/View.php index 7feee32bef..51e0834734 100644 --- a/src/Module/Admin/Logs/View.php +++ b/src/Module/Admin/Logs/View.php @@ -10,7 +10,7 @@ use Friendica\Util\Strings; class View extends BaseAdminModule { - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/PhpInfo.php b/src/Module/Admin/PhpInfo.php index 9c7b597514..3ac7421816 100644 --- a/src/Module/Admin/PhpInfo.php +++ b/src/Module/Admin/PhpInfo.php @@ -6,7 +6,7 @@ use Friendica\Module\BaseAdminModule; class PhpInfo extends BaseAdminModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { parent::rawContent($parameters); diff --git a/src/Module/Admin/Queue.php b/src/Module/Admin/Queue.php index 9b4241a8a8..9ce44ff15a 100644 --- a/src/Module/Admin/Queue.php +++ b/src/Module/Admin/Queue.php @@ -19,7 +19,7 @@ use Friendica\Util\DateTimeFormat; */ class Queue extends BaseAdminModule { - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index bfb4659aa8..4a02e98b82 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -21,7 +21,7 @@ require_once __DIR__ . '/../../../boot.php'; class Site extends BaseAdminModule { - public static function post($parameters) + public static function post(array $parameters = []) { parent::post($parameters); @@ -412,7 +412,7 @@ class Site extends BaseAdminModule $a->internalRedirect('admin/site' . $active_panel); } - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Summary.php b/src/Module/Admin/Summary.php index 24e1cc5845..e10533ee94 100644 --- a/src/Module/Admin/Summary.php +++ b/src/Module/Admin/Summary.php @@ -20,7 +20,7 @@ use Friendica\Util\Network; class Summary extends BaseAdminModule { - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Themes/Details.php b/src/Module/Admin/Themes/Details.php index 45f9239aa1..912adc4297 100644 --- a/src/Module/Admin/Themes/Details.php +++ b/src/Module/Admin/Themes/Details.php @@ -11,7 +11,7 @@ use Friendica\Util\Strings; class Details extends BaseAdminModule { - public static function post($parameters) + public static function post(array $parameters = []) { parent::post($parameters); @@ -39,7 +39,7 @@ class Details extends BaseAdminModule } } - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Themes/Embed.php b/src/Module/Admin/Themes/Embed.php index dc4b6f136e..70a12dadd2 100644 --- a/src/Module/Admin/Themes/Embed.php +++ b/src/Module/Admin/Themes/Embed.php @@ -9,7 +9,7 @@ use Friendica\Util\Strings; class Embed extends BaseAdminModule { - public static function init($parameters) + public static function init(array $parameters = []) { $a = self::getApp(); @@ -23,7 +23,7 @@ class Embed extends BaseAdminModule } } - public static function post($parameters) + public static function post(array $parameters = []) { parent::post($parameters); @@ -53,7 +53,7 @@ class Embed extends BaseAdminModule } } - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Themes/Index.php b/src/Module/Admin/Themes/Index.php index 331f4c477d..8f7843e293 100644 --- a/src/Module/Admin/Themes/Index.php +++ b/src/Module/Admin/Themes/Index.php @@ -11,7 +11,7 @@ use Friendica\Util\Strings; class Index extends BaseAdminModule { - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Tos.php b/src/Module/Admin/Tos.php index 3e6a25f465..6fbdc21e8f 100644 --- a/src/Module/Admin/Tos.php +++ b/src/Module/Admin/Tos.php @@ -9,7 +9,7 @@ use Friendica\Module\BaseAdminModule; class Tos extends BaseAdminModule { - public static function post($parameters) + public static function post(array $parameters = []) { parent::post($parameters); @@ -32,7 +32,7 @@ class Tos extends BaseAdminModule self::getApp()->internalRedirect('admin/tos'); } - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Admin/Users.php b/src/Module/Admin/Users.php index 592b49495a..84332c979f 100644 --- a/src/Module/Admin/Users.php +++ b/src/Module/Admin/Users.php @@ -15,7 +15,7 @@ use Friendica\Util\Temporal; class Users extends BaseAdminModule { - public static function post($parameters) + public static function post(array $parameters = []) { parent::post($parameters); @@ -131,7 +131,7 @@ class Users extends BaseAdminModule $a->internalRedirect('admin/users'); } - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/AllFriends.php b/src/Module/AllFriends.php index 76453a02c3..0d9bf59858 100644 --- a/src/Module/AllFriends.php +++ b/src/Module/AllFriends.php @@ -16,7 +16,7 @@ use Friendica\Util\Proxy as ProxyUtils; */ class AllFriends extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $app = self::getApp(); diff --git a/src/Module/Apps.php b/src/Module/Apps.php index 940bf6b641..bc099ce8bb 100644 --- a/src/Module/Apps.php +++ b/src/Module/Apps.php @@ -13,7 +13,7 @@ use Friendica\Core\Renderer; */ class Apps extends BaseModule { - public static function init($parameters) + public static function init(array $parameters = []) { $privateaddons = Config::get('config', 'private_addons'); if ($privateaddons === "1" && !local_user()) { @@ -21,7 +21,7 @@ class Apps extends BaseModule } } - public static function content($parameters) + public static function content(array $parameters = []) { $apps = Nav::getAppMenu(); diff --git a/src/Module/Attach.php b/src/Module/Attach.php index fe0e063b02..f67104015d 100644 --- a/src/Module/Attach.php +++ b/src/Module/Attach.php @@ -20,7 +20,7 @@ class Attach extends BaseModule /** * @brief Return to user an attached file given the id */ - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $a = self::getApp(); if ($a->argc != 2) { diff --git a/src/Module/BaseAdminModule.php b/src/Module/BaseAdminModule.php index 30c3766640..01aa00d423 100644 --- a/src/Module/BaseAdminModule.php +++ b/src/Module/BaseAdminModule.php @@ -23,7 +23,7 @@ require_once 'boot.php'; */ abstract class BaseAdminModule extends BaseModule { - public static function post($parameters) + public static function post(array $parameters = []) { if (!is_site_admin()) { return; @@ -35,7 +35,7 @@ abstract class BaseAdminModule extends BaseModule } } - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { if (!is_site_admin()) { return ''; @@ -48,7 +48,7 @@ abstract class BaseAdminModule extends BaseModule return ''; } - public static function content($parameters) + public static function content(array $parameters = []) { $a = self::getApp(); diff --git a/src/Module/BaseSettingsModule.php b/src/Module/BaseSettingsModule.php index 6a58ecfe40..4900de42e6 100644 --- a/src/Module/BaseSettingsModule.php +++ b/src/Module/BaseSettingsModule.php @@ -9,7 +9,7 @@ use Friendica\Core\Renderer; class BaseSettingsModule extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $a = self::getApp(); diff --git a/src/Module/Bookmarklet.php b/src/Module/Bookmarklet.php index 2b0b198814..a50f23c256 100644 --- a/src/Module/Bookmarklet.php +++ b/src/Module/Bookmarklet.php @@ -14,7 +14,7 @@ use Friendica\Util\Strings; */ class Bookmarklet extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $_GET['mode'] = 'minimal'; diff --git a/src/Module/Contact.php b/src/Module/Contact.php index 2c5428e0b5..ded5ffbe23 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -75,7 +75,7 @@ class Contact extends BaseModule $a->internalRedirect('contact'); } - public static function post($parameters) + public static function post(array $parameters = []) { $a = self::getApp(); @@ -240,7 +240,7 @@ class Contact extends BaseModule Model\Contact::remove($orig_record['id']); } - public static function content($update = 0) + public static function content(array $parameters = [], $update = 0) { if (!local_user()) { return Login::form($_SERVER['REQUEST_URI']); diff --git a/src/Module/Contact/Hovercard.php b/src/Module/Contact/Hovercard.php index 7f314d361a..a72a7f0a22 100644 --- a/src/Module/Contact/Hovercard.php +++ b/src/Module/Contact/Hovercard.php @@ -18,7 +18,7 @@ use Friendica\Util\Proxy; */ class Hovercard extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $contact_url = $_REQUEST['url'] ?? ''; diff --git a/src/Module/Credits.php b/src/Module/Credits.php index 5abe1601ea..c536dcaa5e 100644 --- a/src/Module/Credits.php +++ b/src/Module/Credits.php @@ -13,7 +13,7 @@ use Friendica\Core\Renderer; */ class Credits extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { /* fill the page with credits */ $credits_string = file_get_contents('CREDITS.txt'); diff --git a/src/Module/Debug/Babel.php b/src/Module/Debug/Babel.php index e1a8b694bd..17187a37c7 100644 --- a/src/Module/Debug/Babel.php +++ b/src/Module/Debug/Babel.php @@ -14,7 +14,7 @@ use Friendica\Util\XML; */ class Babel extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { function visible_whitespace($s) { diff --git a/src/Module/Debug/Feed.php b/src/Module/Debug/Feed.php index 1583b3c882..c764c90003 100644 --- a/src/Module/Debug/Feed.php +++ b/src/Module/Debug/Feed.php @@ -14,7 +14,7 @@ use Friendica\Util\Network; */ class Feed extends BaseModule { - public static function init($parameters) + public static function init(array $parameters = []) { if (!local_user()) { info(L10n::t('You must be logged in to use this module')); @@ -22,7 +22,7 @@ class Feed extends BaseModule } } - public static function content($parameters) + public static function content(array $parameters = []) { $result = []; if (!empty($_REQUEST['url'])) { diff --git a/src/Module/Debug/ItemBody.php b/src/Module/Debug/ItemBody.php index a2cf8df6bf..f166fb0a27 100644 --- a/src/Module/Debug/ItemBody.php +++ b/src/Module/Debug/ItemBody.php @@ -12,7 +12,7 @@ use Friendica\Network\HTTPException; */ class ItemBody extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { if (!local_user()) { throw new HTTPException\UnauthorizedException(L10n::t('Access denied.')); diff --git a/src/Module/Debug/Localtime.php b/src/Module/Debug/Localtime.php index 8c3eac8b61..0d78f08d79 100644 --- a/src/Module/Debug/Localtime.php +++ b/src/Module/Debug/Localtime.php @@ -10,7 +10,7 @@ use Friendica\Util\Temporal; class Localtime extends BaseModule { - public static function post($parameters) + public static function post(array $parameters = []) { $time = ($_REQUEST['time'] ?? '') ?: 'now'; @@ -21,7 +21,7 @@ class Localtime extends BaseModule } } - public static function content($parameters) + public static function content(array $parameters = []) { $app = self::getApp(); diff --git a/src/Module/Debug/Probe.php b/src/Module/Debug/Probe.php index a5785e1aa7..85c5f900fa 100644 --- a/src/Module/Debug/Probe.php +++ b/src/Module/Debug/Probe.php @@ -13,7 +13,7 @@ use Friendica\Network\Probe as NetworkProbe; */ class Probe extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { if (!local_user()) { $e = new HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.')); diff --git a/src/Module/Debug/WebFinger.php b/src/Module/Debug/WebFinger.php index 2b2ebacbf5..90da40bf09 100644 --- a/src/Module/Debug/WebFinger.php +++ b/src/Module/Debug/WebFinger.php @@ -12,7 +12,7 @@ use Friendica\Network\Probe; */ class WebFinger extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { if (!local_user()) { $e = new \Friendica\Network\HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.')); diff --git a/src/Module/Delegation.php b/src/Module/Delegation.php index 46dc7025ee..d2930317c0 100644 --- a/src/Module/Delegation.php +++ b/src/Module/Delegation.php @@ -17,7 +17,7 @@ use Friendica\Network\HTTPException\ForbiddenException; */ class Delegation extends BaseModule { - public static function post($parameters) + public static function post(array $parameters = []) { if (!local_user()) { return; @@ -92,7 +92,7 @@ class Delegation extends BaseModule // NOTREACHED } - public static function content($parameters) + public static function content(array $parameters = []) { if (!local_user()) { throw new ForbiddenException(L10n::t('Permission denied.')); diff --git a/src/Module/Diaspora/Fetch.php b/src/Module/Diaspora/Fetch.php index b69cd1f12b..6e3469c292 100644 --- a/src/Module/Diaspora/Fetch.php +++ b/src/Module/Diaspora/Fetch.php @@ -17,7 +17,7 @@ use Friendica\Util\Strings; */ class Fetch extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $app = self::getApp(); diff --git a/src/Module/Diaspora/Receive.php b/src/Module/Diaspora/Receive.php index d487ab63e5..72b060a848 100644 --- a/src/Module/Diaspora/Receive.php +++ b/src/Module/Diaspora/Receive.php @@ -21,13 +21,13 @@ class Receive extends BaseModule /** @var LoggerInterface */ private static $logger; - public static function init($parameters) + public static function init(array $parameters = []) { /** @var LoggerInterface $logger */ self::$logger = self::getClass(LoggerInterface::class); } - public static function post($parameters) + public static function post(array $parameters = []) { /** @var Configuration $config */ $config = self::getClass(Configuration::class); diff --git a/src/Module/Directory.php b/src/Module/Directory.php index c8523148ff..f24c066507 100644 --- a/src/Module/Directory.php +++ b/src/Module/Directory.php @@ -21,7 +21,7 @@ use Friendica\Util\Strings; */ class Directory extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $app = self::getApp(); $config = $app->getConfig(); diff --git a/src/Module/Feed.php b/src/Module/Feed.php index 70974e61f1..ba21537627 100644 --- a/src/Module/Feed.php +++ b/src/Module/Feed.php @@ -23,7 +23,7 @@ use Friendica\Protocol\OStatus; */ class Feed extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $a = self::getApp(); diff --git a/src/Module/Filer/RemoveTag.php b/src/Module/Filer/RemoveTag.php index 09284bec2e..0246f1db36 100644 --- a/src/Module/Filer/RemoveTag.php +++ b/src/Module/Filer/RemoveTag.php @@ -12,7 +12,7 @@ use Friendica\Util\XML; */ class RemoveTag extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { if (!local_user()) { throw new HTTPException\ForbiddenException(); diff --git a/src/Module/Filer/SaveTag.php b/src/Module/Filer/SaveTag.php index 1db3384ca5..7f0da83bce 100644 --- a/src/Module/Filer/SaveTag.php +++ b/src/Module/Filer/SaveTag.php @@ -14,7 +14,7 @@ use Friendica\Util\XML; */ class SaveTag extends BaseModule { - public static function init($parameters) + public static function init(array $parameters = []) { if (!local_user()) { info(L10n::t('You must be logged in to use this module')); @@ -22,7 +22,7 @@ class SaveTag extends BaseModule } } - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $a = self::getApp(); $logger = $a->getLogger(); diff --git a/src/Module/FollowConfirm.php b/src/Module/FollowConfirm.php index 66ca661856..d1a0a5dda5 100644 --- a/src/Module/FollowConfirm.php +++ b/src/Module/FollowConfirm.php @@ -18,7 +18,7 @@ use Friendica\Util\DateTimeFormat; */ class FollowConfirm extends BaseModule { - public static function post($parameters) + public static function post(array $parameters = []) { $a = self::getApp(); diff --git a/src/Module/Followers.php b/src/Module/Followers.php index 34cb0cdbf9..c2096cd052 100644 --- a/src/Module/Followers.php +++ b/src/Module/Followers.php @@ -14,7 +14,7 @@ use Friendica\Protocol\ActivityPub; */ class Followers extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $a = self::getApp(); diff --git a/src/Module/Following.php b/src/Module/Following.php index cbf33d50f0..8eaa1835c2 100644 --- a/src/Module/Following.php +++ b/src/Module/Following.php @@ -14,7 +14,7 @@ use Friendica\Protocol\ActivityPub; */ class Following extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $a = self::getApp(); diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php index deb17b3859..ee8b220611 100644 --- a/src/Module/Friendica.php +++ b/src/Module/Friendica.php @@ -15,7 +15,7 @@ use Friendica\Model\User; */ class Friendica extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $app = self::getApp(); $config = $app->getConfig(); @@ -88,7 +88,7 @@ class Friendica extends BaseModule ]); } - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $app = self::getApp(); diff --git a/src/Module/Group.php b/src/Module/Group.php index 6368690efd..4c7672c01a 100644 --- a/src/Module/Group.php +++ b/src/Module/Group.php @@ -19,7 +19,7 @@ require_once 'boot.php'; class Group extends BaseModule { - public static function post($parameters) + public static function post(array $parameters = []) { $a = self::getApp(); @@ -132,7 +132,7 @@ class Group extends BaseModule } } - public static function content($parameters) + public static function content(array $parameters = []) { $change = false; diff --git a/src/Module/HTTPException/MethodNotAllowed.php b/src/Module/HTTPException/MethodNotAllowed.php index 3e5d159e70..b4f9e97661 100644 --- a/src/Module/HTTPException/MethodNotAllowed.php +++ b/src/Module/HTTPException/MethodNotAllowed.php @@ -8,7 +8,7 @@ use Friendica\Network\HTTPException; class MethodNotAllowed extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { throw new HTTPException\MethodNotAllowedException(L10n::t('Method Not Allowed.')); } diff --git a/src/Module/HTTPException/PageNotFound.php b/src/Module/HTTPException/PageNotFound.php index 90192efca1..c79d9c2778 100644 --- a/src/Module/HTTPException/PageNotFound.php +++ b/src/Module/HTTPException/PageNotFound.php @@ -8,7 +8,7 @@ use Friendica\Network\HTTPException; class PageNotFound extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { throw new HTTPException\NotFoundException(L10n::t('Page not found.')); } diff --git a/src/Module/Hashtag.php b/src/Module/Hashtag.php index 8708a464a9..a460ae1d98 100644 --- a/src/Module/Hashtag.php +++ b/src/Module/Hashtag.php @@ -15,7 +15,7 @@ use Friendica\Util\Strings; class Hashtag extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $result = []; diff --git a/src/Module/Help.php b/src/Module/Help.php index ae5100d633..3b3ce58704 100644 --- a/src/Module/Help.php +++ b/src/Module/Help.php @@ -14,7 +14,7 @@ use Friendica\Util\Strings; */ class Help extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { Nav::setSelected('help'); diff --git a/src/Module/Home.php b/src/Module/Home.php index 5e9c28af1d..e6fb8c3496 100644 --- a/src/Module/Home.php +++ b/src/Module/Home.php @@ -12,7 +12,7 @@ use Friendica\Core\Renderer; */ class Home extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $app = self::getApp(); $config = $app->getConfig(); diff --git a/src/Module/Inbox.php b/src/Module/Inbox.php index ac99327735..8ab169567e 100644 --- a/src/Module/Inbox.php +++ b/src/Module/Inbox.php @@ -19,7 +19,7 @@ use Friendica\Util\Network; */ class Inbox extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $a = self::getApp(); diff --git a/src/Module/Install.php b/src/Module/Install.php index f4e2c4c76f..71547ad51e 100644 --- a/src/Module/Install.php +++ b/src/Module/Install.php @@ -46,7 +46,7 @@ class Install extends BaseModule */ private static $installer; - public static function init($parameters) + public static function init(array $parameters = []) { $a = self::getApp(); @@ -76,7 +76,7 @@ class Install extends BaseModule self::$currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK; } - public static function post($parameters) + public static function post(array $parameters = []) { $a = self::getApp(); $configCache = $a->getConfigCache(); @@ -149,7 +149,7 @@ class Install extends BaseModule } } - public static function content($parameters) + public static function content(array $parameters = []) { $a = self::getApp(); $configCache = $a->getConfigCache(); diff --git a/src/Module/Invite.php b/src/Module/Invite.php index 162d4489d7..cd616001be 100644 --- a/src/Module/Invite.php +++ b/src/Module/Invite.php @@ -16,7 +16,7 @@ use Friendica\Util\Strings; */ class Invite extends BaseModule { - public static function post($parameters) + public static function post(array $parameters = []) { if (!local_user()) { throw new HTTPException\ForbiddenException(L10n::t('Permission denied.')); @@ -104,7 +104,7 @@ class Invite extends BaseModule notice(L10n::tt('%d message sent.', '%d messages sent.', $total) . EOL); } - public static function content($parameters) + public static function content(array $parameters = []) { if (!local_user()) { throw new HTTPException\ForbiddenException(L10n::t('Permission denied.')); diff --git a/src/Module/Item/Compose.php b/src/Module/Item/Compose.php index 1a88ebbc58..ad0a2d805c 100644 --- a/src/Module/Item/Compose.php +++ b/src/Module/Item/Compose.php @@ -21,7 +21,7 @@ use Friendica\Util\Crypto; class Compose extends BaseModule { - public static function post($parameters) + public static function post(array $parameters = []) { if (!empty($_REQUEST['body'])) { $_REQUEST['return'] = 'network'; @@ -32,7 +32,7 @@ class Compose extends BaseModule } } - public static function content($parameters) + public static function content(array $parameters = []) { if (!local_user()) { return Login::form('compose', false); diff --git a/src/Module/Item/Ignore.php b/src/Module/Item/Ignore.php index 662148076c..4590bc8c84 100644 --- a/src/Module/Item/Ignore.php +++ b/src/Module/Item/Ignore.php @@ -16,7 +16,7 @@ use Friendica\Network\HTTPException; */ class Ignore extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { /** @var L10n $l10n */ $l10n = self::getClass(L10n::class); diff --git a/src/Module/Like.php b/src/Module/Like.php index 3243a12cb9..1c98cbc38c 100644 --- a/src/Module/Like.php +++ b/src/Module/Like.php @@ -13,7 +13,7 @@ use Friendica\Util\Strings; */ class Like extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { if (!Session::isAuthenticated()) { throw new HTTPException\ForbiddenException(); diff --git a/src/Module/Login.php b/src/Module/Login.php index 4cdac27aea..c84af17ccb 100644 --- a/src/Module/Login.php +++ b/src/Module/Login.php @@ -30,7 +30,7 @@ use LightOpenID; */ class Login extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $a = self::getApp(); @@ -41,7 +41,7 @@ class Login extends BaseModule return self::form(Session::get('return_path'), intval(Config::get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED); } - public static function post($parameters) + public static function post(array $parameters = []) { $openid_identity = Session::get('openid_identity'); $openid_server = Session::get('openid_server'); diff --git a/src/Module/Logout.php b/src/Module/Logout.php index ad7eac6b51..49ede01a3d 100644 --- a/src/Module/Logout.php +++ b/src/Module/Logout.php @@ -23,7 +23,7 @@ class Logout extends BaseModule /** * @brief Process logout requests */ - public static function init($parameters) + public static function init(array $parameters = []) { $visitor_home = null; if (remote_user()) { diff --git a/src/Module/Magic.php b/src/Module/Magic.php index 43c17d7259..0f610d123c 100644 --- a/src/Module/Magic.php +++ b/src/Module/Magic.php @@ -20,7 +20,7 @@ use Friendica\Util\Strings; */ class Magic extends BaseModule { - public static function init($parameters) + public static function init(array $parameters = []) { $a = self::getApp(); $ret = ['success' => false, 'url' => '', 'message' => '']; diff --git a/src/Module/Maintenance.php b/src/Module/Maintenance.php index 0a7b67cf80..056bde7325 100644 --- a/src/Module/Maintenance.php +++ b/src/Module/Maintenance.php @@ -14,7 +14,7 @@ use Friendica\Util\Strings; */ class Maintenance extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $config = self::getApp()->getConfig(); diff --git a/src/Module/Manifest.php b/src/Module/Manifest.php index 2fe432a5f4..9e09740594 100644 --- a/src/Module/Manifest.php +++ b/src/Module/Manifest.php @@ -7,7 +7,7 @@ use Friendica\Core\Renderer; class Manifest extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $app = self::getApp(); $config = $app->getConfig(); diff --git a/src/Module/NodeInfo.php b/src/Module/NodeInfo.php index 22e26e97a4..28f23196f9 100644 --- a/src/Module/NodeInfo.php +++ b/src/Module/NodeInfo.php @@ -13,7 +13,7 @@ use Friendica\Core\System; */ class NodeInfo extends BaseModule { - public static function init($parameters) + public static function init(array $parameters = []) { $config = self::getApp()->getConfig(); @@ -22,7 +22,7 @@ class NodeInfo extends BaseModule } } - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $app = self::getApp(); diff --git a/src/Module/Notifications/Notify.php b/src/Module/Notifications/Notify.php index 28047c6989..721a89a694 100644 --- a/src/Module/Notifications/Notify.php +++ b/src/Module/Notifications/Notify.php @@ -14,14 +14,14 @@ use Friendica\Network\HTTPException; */ class Notify extends BaseModule { - public static function init($parameters) + public static function init(array $parameters = []) { if (!local_user()) { throw new HTTPException\UnauthorizedException(L10n::t('Permission denied.')); } } - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $a = self::getApp(); @@ -45,7 +45,7 @@ class Notify extends BaseModule * @return string|void * @throws HTTPException\InternalServerErrorException */ - public static function content($parameters) + public static function content(array $parameters = []) { $a = self::getApp(); diff --git a/src/Module/Objects.php b/src/Module/Objects.php index 528b20a86c..5538be1888 100644 --- a/src/Module/Objects.php +++ b/src/Module/Objects.php @@ -15,7 +15,7 @@ use Friendica\Protocol\ActivityPub; */ class Objects extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $a = self::getApp(); diff --git a/src/Module/Oembed.php b/src/Module/Oembed.php index e31fde6313..f9d9284281 100644 --- a/src/Module/Oembed.php +++ b/src/Module/Oembed.php @@ -17,7 +17,7 @@ use Friendica\Util\Strings; */ class Oembed extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $a = self::getApp(); diff --git a/src/Module/OpenSearch.php b/src/Module/OpenSearch.php index 89cf53055d..309db6af95 100644 --- a/src/Module/OpenSearch.php +++ b/src/Module/OpenSearch.php @@ -16,7 +16,7 @@ class OpenSearch extends BaseModule /** * @throws \Exception */ - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { header('Content-type: application/opensearchdescription+xml'); diff --git a/src/Module/Outbox.php b/src/Module/Outbox.php index 334e7af718..c2024151e5 100644 --- a/src/Module/Outbox.php +++ b/src/Module/Outbox.php @@ -14,7 +14,7 @@ use Friendica\Protocol\ActivityPub; */ class Outbox extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $a = self::getApp(); diff --git a/src/Module/Owa.php b/src/Module/Owa.php index a8c980373d..ca4eec47ff 100644 --- a/src/Module/Owa.php +++ b/src/Module/Owa.php @@ -27,7 +27,7 @@ use Friendica\Util\Strings; */ class Owa extends BaseModule { - public static function init($parameters) + public static function init(array $parameters = []) { $ret = [ 'success' => false ]; diff --git a/src/Module/Photo.php b/src/Module/Photo.php index 58199a08da..9987c38f51 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -23,7 +23,7 @@ class Photo extends BaseModule * Fetch a photo or an avatar, in optional size, check for permissions and * return the image */ - public static function init($parameters) + public static function init(array $parameters = []) { $a = self::getApp(); // @TODO: Replace with parameter from router diff --git a/src/Module/Profile.php b/src/Module/Profile.php index 527c7118e9..69db45acf1 100644 --- a/src/Module/Profile.php +++ b/src/Module/Profile.php @@ -33,7 +33,7 @@ class Profile extends BaseModule public static $which = ''; public static $profile = 0; - public static function init($parameters) + public static function init(array $parameters = []) { $a = self::getApp(); @@ -51,7 +51,7 @@ class Profile extends BaseModule } } - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { if (ActivityPub::isRequest()) { $user = DBA::selectFirst('user', ['uid'], ['nickname' => self::$which]); @@ -75,7 +75,7 @@ class Profile extends BaseModule } } - public static function content($update = 0) + public static function content(array $parameters = [], $update = 0) { $a = self::getApp(); diff --git a/src/Module/Profile/Contacts.php b/src/Module/Profile/Contacts.php index 3df256b9d5..8069248f82 100644 --- a/src/Module/Profile/Contacts.php +++ b/src/Module/Profile/Contacts.php @@ -18,7 +18,7 @@ use Friendica\Util\Proxy as ProxyUtils; class Contacts extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { if (Config::get('system', 'block_public') && !Session::isAuthenticated()) { throw new \Friendica\Network\HTTPException\NotFoundException(L10n::t('User not found.')); diff --git a/src/Module/Proxy.php b/src/Module/Proxy.php index 17509f662d..fbf4b8bd5c 100644 --- a/src/Module/Proxy.php +++ b/src/Module/Proxy.php @@ -30,7 +30,7 @@ class Proxy extends BaseModule * Sets application instance and checks if /proxy/ path is writable. * */ - public static function init($parameters) + public static function init(array $parameters = []) { // Set application instance here $a = self::getApp(); diff --git a/src/Module/PublicRSAKey.php b/src/Module/PublicRSAKey.php index 36502cc86b..f652811b54 100644 --- a/src/Module/PublicRSAKey.php +++ b/src/Module/PublicRSAKey.php @@ -12,7 +12,7 @@ use Friendica\Network\HTTPException\BadRequestException; */ class PublicRSAKey extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $app = self::getApp(); diff --git a/src/Module/RandomProfile.php b/src/Module/RandomProfile.php index 8edc43bf0c..c5b31afeef 100644 --- a/src/Module/RandomProfile.php +++ b/src/Module/RandomProfile.php @@ -11,7 +11,7 @@ use Friendica\Model\GContact; */ class RandomProfile extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $a = self::getApp(); diff --git a/src/Module/ReallySimpleDiscovery.php b/src/Module/ReallySimpleDiscovery.php index 838843fbf0..7cf0db6c7b 100644 --- a/src/Module/ReallySimpleDiscovery.php +++ b/src/Module/ReallySimpleDiscovery.php @@ -11,7 +11,7 @@ use Friendica\Util\XML; */ class ReallySimpleDiscovery extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { header('Content-Type: text/xml'); diff --git a/src/Module/Register.php b/src/Module/Register.php index 6993415e66..aaca8c02e2 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -35,7 +35,7 @@ class Register extends BaseModule * * @return string */ - public static function content($parameters) + public static function content(array $parameters = []) { // logged in users can register others (people/pages/groups) // even with closed registrations, unless specifically prohibited by site policy. @@ -152,7 +152,7 @@ class Register extends BaseModule * Extend this method if the module is supposed to process POST requests. * Doesn't display any content */ - public static function post($parameters) + public static function post(array $parameters = []) { BaseModule::checkFormSecurityTokenRedirectOnError('/register', 'register'); diff --git a/src/Module/RobotsTxt.php b/src/Module/RobotsTxt.php index 47e11201d9..db83777e8e 100644 --- a/src/Module/RobotsTxt.php +++ b/src/Module/RobotsTxt.php @@ -9,7 +9,7 @@ use Friendica\BaseModule; */ class RobotsTxt extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $allDisalloweds = [ '/settings/', diff --git a/src/Module/Search/Acl.php b/src/Module/Search/Acl.php index e886a8fdb9..74ce55fb53 100644 --- a/src/Module/Search/Acl.php +++ b/src/Module/Search/Acl.php @@ -31,7 +31,7 @@ class Acl extends BaseModule const TYPE_PRIVATE_MESSAGE = 'm'; const TYPE_ANY_CONTACT = 'a'; - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { if (!local_user()) { throw new HTTPException\UnauthorizedException(L10n::t('You must be logged in to use this module.')); diff --git a/src/Module/Search/Directory.php b/src/Module/Search/Directory.php index c6734ac87c..b18847afe9 100644 --- a/src/Module/Search/Directory.php +++ b/src/Module/Search/Directory.php @@ -13,7 +13,7 @@ use Friendica\Util\Strings; */ class Directory extends BaseSearchModule { - public static function content($parameters) + public static function content(array $parameters = []) { if (!local_user()) { notice(L10n::t('Permission denied.')); diff --git a/src/Module/Search/Index.php b/src/Module/Search/Index.php index 6f0f21f62a..7c52c7e79d 100644 --- a/src/Module/Search/Index.php +++ b/src/Module/Search/Index.php @@ -23,7 +23,7 @@ use Friendica\Util\Strings; class Index extends BaseSearchModule { - public static function content($parameters) + public static function content(array $parameters = []) { $search = (!empty($_GET['q']) ? Strings::escapeTags(trim(rawurldecode($_GET['q']))) : ''); diff --git a/src/Module/Search/Saved.php b/src/Module/Search/Saved.php index 42429c47bd..88668272de 100644 --- a/src/Module/Search/Saved.php +++ b/src/Module/Search/Saved.php @@ -10,7 +10,7 @@ use Friendica\Util\Strings; class Saved extends BaseModule { - public static function init($parameters) + public static function init(array $parameters = []) { /** @var Arguments $args */ $args = self::getClass(Arguments::class); diff --git a/src/Module/Settings/Delegation.php b/src/Module/Settings/Delegation.php index 8048d3bf8f..e3c2b8d34c 100644 --- a/src/Module/Settings/Delegation.php +++ b/src/Module/Settings/Delegation.php @@ -20,7 +20,7 @@ use Friendica\Util\Strings; */ class Delegation extends BaseSettingsModule { - public static function post($parameters) + public static function post(array $parameters = []) { if (!local_user() || !empty(self::getApp()->user['uid']) && self::getApp()->user['uid'] != local_user()) { throw new HTTPException\ForbiddenException(L10n::t('Permission denied.')); @@ -46,7 +46,7 @@ class Delegation extends BaseSettingsModule DBA::update('user', ['parent-uid' => $parent_uid], ['uid' => local_user()]); } - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); diff --git a/src/Module/Settings/TwoFactor/AppSpecific.php b/src/Module/Settings/TwoFactor/AppSpecific.php index 720fb9a831..72b233f422 100644 --- a/src/Module/Settings/TwoFactor/AppSpecific.php +++ b/src/Module/Settings/TwoFactor/AppSpecific.php @@ -20,7 +20,7 @@ class AppSpecific extends BaseSettingsModule { private static $appSpecificPassword = null; - public static function init($parameters) + public static function init(array $parameters = []) { if (!local_user()) { return; @@ -38,7 +38,7 @@ class AppSpecific extends BaseSettingsModule } } - public static function post($parameters) + public static function post(array $parameters = []) { if (!local_user()) { return; @@ -81,7 +81,7 @@ class AppSpecific extends BaseSettingsModule } } - public static function content($parameters) + public static function content(array $parameters = []) { if (!local_user()) { return Login::form('settings/2fa/app_specific'); diff --git a/src/Module/Settings/TwoFactor/Index.php b/src/Module/Settings/TwoFactor/Index.php index 9a661ef731..34d6f97b49 100644 --- a/src/Module/Settings/TwoFactor/Index.php +++ b/src/Module/Settings/TwoFactor/Index.php @@ -17,7 +17,7 @@ use PragmaRX\Google2FA\Google2FA; class Index extends BaseSettingsModule { - public static function post($parameters) + public static function post(array $parameters = []) { if (!local_user()) { return; @@ -73,7 +73,7 @@ class Index extends BaseSettingsModule } } - public static function content($parameters) + public static function content(array $parameters = []) { if (!local_user()) { return Login::form('settings/2fa'); diff --git a/src/Module/Settings/TwoFactor/Recovery.php b/src/Module/Settings/TwoFactor/Recovery.php index b3155f6e9e..0d7de7d902 100644 --- a/src/Module/Settings/TwoFactor/Recovery.php +++ b/src/Module/Settings/TwoFactor/Recovery.php @@ -18,7 +18,7 @@ use Friendica\Module\Login; */ class Recovery extends BaseSettingsModule { - public static function init($parameters) + public static function init(array $parameters = []) { if (!local_user()) { return; @@ -36,7 +36,7 @@ class Recovery extends BaseSettingsModule } } - public static function post($parameters) + public static function post(array $parameters = []) { if (!local_user()) { return; @@ -53,7 +53,7 @@ class Recovery extends BaseSettingsModule } } - public static function content($parameters) + public static function content(array $parameters = []) { if (!local_user()) { return Login::form('settings/2fa/recovery'); diff --git a/src/Module/Settings/TwoFactor/Verify.php b/src/Module/Settings/TwoFactor/Verify.php index 3957a5350a..63c186e3a8 100644 --- a/src/Module/Settings/TwoFactor/Verify.php +++ b/src/Module/Settings/TwoFactor/Verify.php @@ -24,7 +24,7 @@ use PragmaRX\Google2FA\Google2FA; */ class Verify extends BaseSettingsModule { - public static function init($parameters) + public static function init(array $parameters = []) { if (!local_user()) { return; @@ -43,7 +43,7 @@ class Verify extends BaseSettingsModule } } - public static function post($parameters) + public static function post(array $parameters = []) { if (!local_user()) { return; @@ -69,7 +69,7 @@ class Verify extends BaseSettingsModule } } - public static function content($parameters) + public static function content(array $parameters = []) { if (!local_user()) { return Login::form('settings/2fa/verify'); diff --git a/src/Module/Settings/UserExport.php b/src/Module/Settings/UserExport.php index c571be2505..19722a18e2 100644 --- a/src/Module/Settings/UserExport.php +++ b/src/Module/Settings/UserExport.php @@ -32,7 +32,7 @@ class UserExport extends BaseSettingsModule * If there is an action required through the URL / path, react * accordingly and export the requested data. **/ - public static function content($parameters) + public static function content(array $parameters = []) { parent::content($parameters); @@ -59,7 +59,7 @@ class UserExport extends BaseSettingsModule * to the browser which then offers a save / open dialog * to the user. **/ - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $args = self::getClass(Arguments::class); if ($args->getArgc() == 3) { diff --git a/src/Module/Smilies.php b/src/Module/Smilies.php index a2b91f54de..a808ce820c 100644 --- a/src/Module/Smilies.php +++ b/src/Module/Smilies.php @@ -12,7 +12,7 @@ use Friendica\Core\System; */ class Smilies extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $app = self::getApp(); @@ -26,7 +26,7 @@ class Smilies extends BaseModule } } - public static function content($parameters) + public static function content(array $parameters = []) { $smilies = Content\Smilies::getList(); $count = count($smilies['texts'] ?? []); diff --git a/src/Module/Starred.php b/src/Module/Starred.php index 1aab10307d..dbda9f1076 100644 --- a/src/Module/Starred.php +++ b/src/Module/Starred.php @@ -10,7 +10,7 @@ use Friendica\Model\Item; */ class Starred extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { if (!local_user()) { exit(); diff --git a/src/Module/Statistics.php b/src/Module/Statistics.php index 53f9acf95f..6e599ac9b1 100644 --- a/src/Module/Statistics.php +++ b/src/Module/Statistics.php @@ -8,7 +8,7 @@ use Friendica\Core\System; class Statistics extends BaseModule { - public static function init($parameters) + public static function init(array $parameters = []) { $config = self::getApp()->getConfig(); @@ -17,7 +17,7 @@ class Statistics extends BaseModule } } - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $config = self::getApp()->getConfig(); $logger = self::getApp()->getLogger(); diff --git a/src/Module/Theme.php b/src/Module/Theme.php index 762e398556..e9ce8d396f 100644 --- a/src/Module/Theme.php +++ b/src/Module/Theme.php @@ -10,7 +10,7 @@ use Friendica\Util\Strings; */ class Theme extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { header("Content-Type: text/css"); diff --git a/src/Module/ThemeDetails.php b/src/Module/ThemeDetails.php index 611134d638..40bfb7a871 100644 --- a/src/Module/ThemeDetails.php +++ b/src/Module/ThemeDetails.php @@ -10,7 +10,7 @@ use Friendica\Core\Theme; */ class ThemeDetails extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { if (!empty($_REQUEST['theme'])) { $theme = $_REQUEST['theme']; diff --git a/src/Module/ToggleMobile.php b/src/Module/ToggleMobile.php index 07e6fd87d1..0efc2e54b5 100644 --- a/src/Module/ToggleMobile.php +++ b/src/Module/ToggleMobile.php @@ -9,7 +9,7 @@ use Friendica\BaseModule; */ class ToggleMobile extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $a = self::getApp(); diff --git a/src/Module/Tos.php b/src/Module/Tos.php index c69557d5dc..ea29a5e072 100644 --- a/src/Module/Tos.php +++ b/src/Module/Tos.php @@ -47,7 +47,7 @@ class Tos extends BaseModule * dealings with their own node so a TOS is not necessary. * **/ - public static function init($parameters) + public static function init(array $parameters = []) { if (strlen(Config::get('system','singleuser'))) { self::getApp()->internalRedirect('profile/' . Config::get('system','singleuser')); @@ -66,7 +66,7 @@ class Tos extends BaseModule * @return string * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function content($parameters) { + public static function content(array $parameters = []) { $tpl = Renderer::getMarkupTemplate('tos.tpl'); if (Config::get('system', 'tosdisplay')) { return Renderer::replaceMacros($tpl, [ diff --git a/src/Module/TwoFactor/Recovery.php b/src/Module/TwoFactor/Recovery.php index 82cfc80eac..bd87836463 100644 --- a/src/Module/TwoFactor/Recovery.php +++ b/src/Module/TwoFactor/Recovery.php @@ -15,14 +15,14 @@ use Friendica\Model\TwoFactor\RecoveryCode; */ class Recovery extends BaseModule { - public static function init($parameters) + public static function init(array $parameters = []) { if (!local_user()) { return; } } - public static function post($parameters) + public static function post(array $parameters = []) { if (!local_user()) { return; @@ -48,7 +48,7 @@ class Recovery extends BaseModule } } - public static function content($parameters) + public static function content(array $parameters = []) { if (!local_user()) { self::getApp()->internalRedirect(); diff --git a/src/Module/TwoFactor/Verify.php b/src/Module/TwoFactor/Verify.php index daef9f60a5..f6f040f5a7 100644 --- a/src/Module/TwoFactor/Verify.php +++ b/src/Module/TwoFactor/Verify.php @@ -18,7 +18,7 @@ class Verify extends BaseModule { private static $errors = []; - public static function post($parameters) + public static function post(array $parameters = []) { if (!local_user()) { return; @@ -45,7 +45,7 @@ class Verify extends BaseModule } } - public static function content($parameters) + public static function content(array $parameters = []) { if (!local_user()) { self::getApp()->internalRedirect(); diff --git a/src/Module/Welcome.php b/src/Module/Welcome.php index d92f4109ce..f69991e496 100644 --- a/src/Module/Welcome.php +++ b/src/Module/Welcome.php @@ -11,7 +11,7 @@ use Friendica\Core\Renderer; */ class Welcome extends BaseModule { - public static function content($parameters) + public static function content(array $parameters = []) { $config = self::getApp()->getConfig(); diff --git a/src/Module/WellKnown/HostMeta.php b/src/Module/WellKnown/HostMeta.php index acf2cca866..cb344b695e 100644 --- a/src/Module/WellKnown/HostMeta.php +++ b/src/Module/WellKnown/HostMeta.php @@ -13,7 +13,7 @@ use Friendica\Util\Crypto; */ class HostMeta extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $app = self::getApp(); $config = $app->getConfig(); diff --git a/src/Module/WellKnown/XSocialRelay.php b/src/Module/WellKnown/XSocialRelay.php index bbd51069d9..5d8f4e817c 100644 --- a/src/Module/WellKnown/XSocialRelay.php +++ b/src/Module/WellKnown/XSocialRelay.php @@ -11,7 +11,7 @@ use Friendica\Model\Search; */ class XSocialRelay extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $app = self::getApp(); $config = $app->getConfig(); diff --git a/src/Module/Xrd.php b/src/Module/Xrd.php index 4bad558a4e..79e0883a87 100644 --- a/src/Module/Xrd.php +++ b/src/Module/Xrd.php @@ -17,7 +17,7 @@ use Friendica\Util\Strings; */ class Xrd extends BaseModule { - public static function rawContent($parameters) + public static function rawContent(array $parameters = []) { $app = self::getApp(); diff --git a/static/dbstructure.config.php.sic b/static/dbstructure.config.php.sic new file mode 100755 index 0000000000..65e0b26a6a --- /dev/null +++ b/static/dbstructure.config.php.sic @@ -0,0 +1,1439 @@ +" => [ + * "comment" => "Description of the table", + * "fields" => [ + * "" => [ + * "type" => "{()} ", + * "not null" => 0|1, + * {"extra" => "auto_increment",} + * {"default" => "",} + * {"default" => NULL_DATE,} (for datetime fields) + * {"primary" => "1",} + * {"relation" => ["" => ""],} + * "comment" => "Description of the fields" + * ], + * ... + * ], + * "indexes" => [ + * "PRIMARY" => ["", ...], + * "" => [{"UNIQUE",} "{()}", ...] + * ... + * ], + * ], + * + * If you need to make any change, make sure to increment the DB_UPDATE_VERSION constant value below. + * + */ + +use Friendica\Database\DBA; + +if (!defined('DB_UPDATE_VERSION')) { + define('DB_UPDATE_VERSION', 1324); +} + +return [ + "2fa_app_specific_password" => [ + "comment" => "Two-factor app-specific _password", + "fields" => [ + "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"], + "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"], + "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"], + "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"], + "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uid_description" => ["uid", "description(190)"], + ] + ], + "2fa_recovery_codes" => [ + "comment" => "Two-factor authentication recovery codes", + "fields" => [ + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"], + "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"], + "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"], + "used" => ["type" => "datetime", "comment" => "Datetime the code was used"], + ], + "indexes" => [ + "PRIMARY" => ["uid", "code"] + ] + ], + "addon" => [ + "comment" => "registered addons", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""], + "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"], + "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"], + "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"], + "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"], + "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"], + "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "name" => ["UNIQUE", "name"], + ] + ], + "apcontact" => [ + "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation", + "fields" => [ + "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"], + "uuid" => ["type" => "varchar(255)", "comment" => ""], + "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""], + "following" => ["type" => "varchar(255)", "comment" => ""], + "followers" => ["type" => "varchar(255)", "comment" => ""], + "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""], + "outbox" => ["type" => "varchar(255)", "comment" => ""], + "sharedinbox" => ["type" => "varchar(255)", "comment" => ""], + "manually-approve" => ["type" => "boolean", "comment" => ""], + "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "name" => ["type" => "varchar(255)", "comment" => ""], + "about" => ["type" => "text", "comment" => ""], + "photo" => ["type" => "varchar(255)", "comment" => ""], + "addr" => ["type" => "varchar(255)", "comment" => ""], + "alias" => ["type" => "varchar(255)", "comment" => ""], + "pubkey" => ["type" => "text", "comment" => ""], + "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"], + "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"], + "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""] + ], + "indexes" => [ + "PRIMARY" => ["url"], + "addr" => ["addr(32)"], + "alias" => ["alias(190)"], + "url" => ["followers(190)"] + ] + ], + "attach" => [ + "comment" => "file attachments", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], + "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"], + "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"], + "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"], + "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"], + "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"], + "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"], + "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"], + "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"], + "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"], + "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"], + "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"], + "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + ] + ], + "auth_codes" => [ + "comment" => "OAuth usage", + "fields" => [ + "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""], + "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"], + "comment" => ""], + "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""], + "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""], + "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + ] + ], + "cache" => [ + "comment" => "Stores temporary data", + "fields" => [ + "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"], + "v" => ["type" => "mediumtext", "comment" => "cached serialized value"], + "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"], + "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"], + ], + "indexes" => [ + "PRIMARY" => ["k"], + "k_expires" => ["k", "expires"], + ] + ], + "challenge" => [ + "comment" => "", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + ] + ], + "clients" => [ + "comment" => "OAuth usage", + "fields" => [ + "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""], + "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""], + "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""], + "name" => ["type" => "text", "comment" => ""], + "icon" => ["type" => "text", "comment" => ""], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + ], + "indexes" => [ + "PRIMARY" => ["client_id"], + ] + ], + "config" => [ + "comment" => "main configuration storage", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""], + "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""], + "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""], + "v" => ["type" => "mediumtext", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "cat_k" => ["UNIQUE", "cat", "k"], + ] + ], + "contact" => [ + "comment" => "contact table", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"], + "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"], + "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"], + "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"], + "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"], + "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"], + "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"], + "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""], + "about" => ["type" => "text", "comment" => ""], + "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"], + "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""], + "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"], + "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"], + "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"], + "site-pubkey" => ["type" => "text", "comment" => ""], + "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"], + "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"], + "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "request" => ["type" => "varchar(255)", "comment" => ""], + "notify" => ["type" => "varchar(255)", "comment" => ""], + "poll" => ["type" => "varchar(255)", "comment" => ""], + "confirm" => ["type" => "varchar(255)", "comment" => ""], + "poco" => ["type" => "varchar(255)", "comment" => ""], + "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"], + "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"], + "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"], + "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"], + "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"], + "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"], + "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"], + "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"], + "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"], + "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""], + "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""], + "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"], + "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""], + "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"], + "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"], + "baseurl" => ["type" => "varchar(255)", "default" => "", "comment" => "baseurl of the contact"], + "reason" => ["type" => "text", "comment" => ""], + "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""], + "info" => ["type" => "mediumtext", "comment" => ""], + "profile-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""], + "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""], + "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uid_name" => ["uid", "name(190)"], + "self_uid" => ["self", "uid"], + "alias_uid" => ["alias(32)", "uid"], + "pending_uid" => ["pending", "uid"], + "blocked_uid" => ["blocked", "uid"], + "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"], + "uid_network_batch" => ["uid", "network", "batch(64)"], + "addr_uid" => ["addr(32)", "uid"], + "nurl_uid" => ["nurl(32)", "uid"], + "nick_uid" => ["nick(32)", "uid"], + "dfrn-id" => ["dfrn-id(64)"], + "issued-id" => ["issued-id(64)"], + ] + ], + "conv" => [ + "comment" => "private messages", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"], + "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], + "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"], + "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"], + "subject" => ["type" => "text", "comment" => "subject of initial message"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uid" => ["uid"], + ] + ], + "conversation" => [ + "comment" => "Raw data and structure information for messages", + "fields" => [ + "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"], + "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"], + "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"], + "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"], + "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"], + "source" => ["type" => "mediumtext", "comment" => "Original source"], + "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"], + ], + "indexes" => [ + "PRIMARY" => ["item-uri"], + "conversation-uri" => ["conversation-uri"], + "received" => ["received"], + ] + ], + "diaspora-interaction" => [ + "comment" => "Signed Diaspora Interaction", + "fields" => [ + "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"], + "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"] + ], + "indexes" => [ + "PRIMARY" => ["uri-id"] + ] + ], + "event" => [ + "comment" => "Events", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], + "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"], + "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"], + "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"], + "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"], + "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"], + "summary" => ["type" => "text", "comment" => "short description or title of the event"], + "desc" => ["type" => "text", "comment" => "event description"], + "location" => ["type" => "text", "comment" => "event location"], + "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"], + "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"], + "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"], + "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"], + "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"], + "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"], + "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"], + "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uid_start" => ["uid", "start"], + ] + ], + "fcontact" => [ + "comment" => "Diaspora compatible contacts - used in the Diaspora implementation", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"], + "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""], + "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "pubkey" => ["type" => "text", "comment" => ""], + "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "addr" => ["addr(32)"], + "url" => ["UNIQUE", "url(190)"], + ] + ], + "fsuggest" => [ + "comment" => "friend suggestion stuff", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""], + "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "note" => ["type" => "text", "comment" => ""], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + ] + ], + "gcign" => [ + "comment" => "contacts ignored by friend suggestions", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"], + "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uid" => ["uid"], + "gcid" => ["gcid"], + ] + ], + "gcontact" => [ + "comment" => "global contacts", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"], + "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"], + "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"], + "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"], + "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""], + "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""], + "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""], + "archive_date" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""], + "archived" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "about" => ["type" => "text", "comment" => ""], + "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"], + "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""], + "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""], + "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"], + "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""], + "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"], + "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"], + "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"], + "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "notify" => ["type" => "varchar(255)", "comment" => ""], + "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "nurl" => ["UNIQUE", "nurl(190)"], + "name" => ["name(64)"], + "nick" => ["nick(32)"], + "addr" => ["addr(64)"], + "hide_network_updated" => ["hide", "network", "updated"], + "updated" => ["updated"], + ] + ], + "glink" => [ + "comment" => "'friends of friends' linkages derived from poco", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""], + "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""], + "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"], + "gcid" => ["gcid"], + ] + ], + "group" => [ + "comment" => "privacy groups, group info", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], + "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"], + "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"], + "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uid" => ["uid"], + ] + ], + "group_member" => [ + "comment" => "privacy groups, member info", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"], + "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "contactid" => ["contact-id"], + "gid_contactid" => ["UNIQUE", "gid", "contact-id"], + ] + ], + "gserver" => [ + "comment" => "Global servers", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "info" => ["type" => "text", "comment" => ""], + "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""], + "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"], + "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""], + "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"], + "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""], + "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""], + "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "nurl" => ["UNIQUE", "nurl(190)"], + ] + ], + "gserver-tag" => [ + "comment" => "Tags that the server has subscribed", + "fields" => [ + "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1", + "comment" => "The id of the gserver"], + "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"], + ], + "indexes" => [ + "PRIMARY" => ["gserver-id", "tag"], + "tag" => ["tag"], + ] + ], + "hook" => [ + "comment" => "addon hook registry", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"], + "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"], + "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"], + "priority" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => "not yet implemented - can be used to sort conflicts in hook handling by calling handlers in priority order"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "hook_file_function" => ["UNIQUE", "hook", "file", "function"], + ] + ], + "inbox-status" => [ + "comment" => "Status of ActivityPub inboxes", + "fields" => [ + "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"], + "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"], + "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"], + "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"], + "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"], + "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"] + ], + "indexes" => [ + "PRIMARY" => ["url"] + ] + ], + "intro" => [ + "comment" => "", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""], + "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""], + "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "note" => ["type" => "text", "comment" => ""], + "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""], + "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + ] + ], + "item" => [ + "comment" => "Structure for all posts", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]], + "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"], + "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"], + "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"], + "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id of the parent to this item if it is a reply of some form; otherwise this must be set to the id of this item"], + "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"], + "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"], + "thr-parent" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "If the parent of this item is not the top-level item in the conversation, the uri of the immediate parent; otherwise set to parent-uri"], + "thr-parent-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."], + "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"], + "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"], + "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"], + "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date that something in the conversation changed, indicating clients should fetch the conversation again"], + "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"], + "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the owner of this item"], + "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the author of this item"], + "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"], + "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"], + "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"], + "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "distribution is restricted"], + "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"], + // User specific fields. Eventually they will move to user-item + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"], + "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"], + "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"], + "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"], + "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"], + "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"], + "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"], + "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "psid" => ["type" => "int unsigned", "relation" => ["permissionset" => "id"], "comment" => "ID of the permission set of this post"], + // It has to be decided whether these fields belong to the user or the structure + "resource-id" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type"], + "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"], + // Could possibly be replaced by the "attach" table? + "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"], + // Deprecated fields. Will be removed in upcoming versions + "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"], + "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"], + "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"], + "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"], + "postopts" => ["type" => "text", "comment" => "Deprecated"], + "inform" => ["type" => "mediumtext", "comment" => "Deprecated"], + "type" => ["type" => "varchar(20)", "comment" => "Deprecated"], + "bookmark" => ["type" => "boolean", "comment" => "Deprecated"], + "file" => ["type" => "mediumtext", "comment" => "Deprecated"], + "location" => ["type" => "varchar(255)", "comment" => "Deprecated"], + "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"], + "tag" => ["type" => "mediumtext", "comment" => "Deprecated"], + "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"], + "title" => ["type" => "varchar(255)", "comment" => "Deprecated"], + "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"], + "body" => ["type" => "mediumtext", "comment" => "Deprecated"], + "app" => ["type" => "varchar(255)", "comment" => "Deprecated"], + "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"], + "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"], + "object" => ["type" => "text", "comment" => "Deprecated"], + "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"], + "target" => ["type" => "text", "comment" => "Deprecated"], + "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"], + "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"], + "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"], + "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"], + "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"], + "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"], + "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"], + "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "guid" => ["guid(191)"], + "uri" => ["uri(191)"], + "parent" => ["parent"], + "parent-uri" => ["parent-uri(191)"], + "extid" => ["extid(191)"], + "uid_id" => ["uid", "id"], + "uid_contactid_id" => ["uid", "contact-id", "id"], + "uid_received" => ["uid", "received"], + "uid_commented" => ["uid", "commented"], + "uid_unseen_contactid" => ["uid", "unseen", "contact-id"], + "uid_network_received" => ["uid", "network", "received"], + "uid_network_commented" => ["uid", "network", "commented"], + "uid_thrparent" => ["uid", "thr-parent(190)"], + "uid_parenturi" => ["uid", "parent-uri(190)"], + "uid_contactid_received" => ["uid", "contact-id", "received"], + "authorid_received" => ["author-id", "received"], + "ownerid" => ["owner-id"], + "contact-id" => ["contact-id"], + "uid_uri" => ["uid", "uri(190)"], + "resource-id" => ["resource-id"], + "deleted_changed" => ["deleted", "changed"], + "uid_wall_changed" => ["uid", "wall", "changed"], + "uid_eventid" => ["uid", "event-id"], + "icid" => ["icid"], + "iaid" => ["iaid"], + "psid_wall" => ["psid", "wall"], + ] + ], + "item-activity" => [ + "comment" => "Activities for items", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]], + "uri" => ["type" => "varchar(255)", "comment" => ""], + "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"], + "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"], + "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""] + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uri-hash" => ["UNIQUE", "uri-hash"], + "uri" => ["uri(191)"], + "uri-id" => ["uri-id"] + ] + ], + "item-content" => [ + "comment" => "Content for all posts", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]], + "uri" => ["type" => "varchar(255)", "comment" => ""], + "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"], + "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"], + "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"], + "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "body" => ["type" => "mediumtext", "comment" => "item body content"], + "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"], + "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"], + "language" => ["type" => "text", "comment" => "Language information about this post"], + "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"], + "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""], + "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"], + "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"], + "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"], + "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"], + "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"], + "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"], + "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"] + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"], + "uri" => ["uri(191)"], + "plink" => ["plink(191)"], + "uri-id" => ["uri-id"] + ] + ], + "item-delivery-data" => [ + "comment" => "Delivery data for items", + "fields" => [ + "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"], + "postopts" => ["type" => "text", "comment" => "External post connectors add their network name to this comma-separated string to identify that they should be delivered to these networks during delivery"], + "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"], + "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"], + "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"], + "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"], + "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"], + "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"], + "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"], + "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"], + "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"], + ], + "indexes" => [ + "PRIMARY" => ["iid"], + ] + ], + "item-uri" => [ + "comment" => "URI and GUID for items", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"], + "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"], + "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"] + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uri" => ["UNIQUE", "uri"], + "guid" => ["guid"] + ] + ], + "locks" => [ + "comment" => "", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""], + "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"], + "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "name_expires" => ["name", "expires"] + ] + ], + "mail" => [ + "comment" => "private messages", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], + "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"], + "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"], + "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"], + "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"], + "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"], + "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"], + "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "body" => ["type" => "mediumtext", "comment" => ""], + "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"], + "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"], + "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uid_seen" => ["uid", "seen"], + "convid" => ["convid"], + "uri" => ["uri(64)"], + "parent-uri" => ["parent-uri(64)"], + "contactid" => ["contact-id(32)"], + ] + ], + "mailacct" => [ + "comment" => "Mail account data for fetching mails", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""], + "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "pass" => ["type" => "text", "comment" => ""], + "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + ] + ], + "manage" => [ + "comment" => "table of accounts that can manage each other", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uid_mid" => ["UNIQUE", "uid", "mid"], + ] + ], + "notify" => [ + "comment" => "notifications", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""], + "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "msg" => ["type" => "mediumtext", "comment" => ""], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], + "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"], + "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""], + "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""], + "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""], + "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"], + "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"] + ], + "indexes" => [ + "PRIMARY" => ["id"], + "hash_uid" => ["hash", "uid"], + "seen_uid_date" => ["seen", "uid", "date"], + "uid_date" => ["uid", "date"], + "uid_type_link" => ["uid", "type", "link(190)"], + ] + ], + "notify-threads" => [ + "comment" => "", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""], + "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], + "comment" => ""], + "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], + "comment" => "User id"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + ] + ], + "oembed" => [ + "comment" => "cache for OEmbed queries", + "fields" => [ + "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"], + "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"], + "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"], + ], + "indexes" => [ + "PRIMARY" => ["url", "maxwidth"], + "created" => ["created"], + ] + ], + "openwebauth-token" => [ + "comment" => "Store OpenWebAuth token to verify contacts", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"], + "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"], + "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + ] + ], + "parsed_url" => [ + "comment" => "cache for 'parse_url' queries", + "fields" => [ + "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"], + "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"], + "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"], + "content" => ["type" => "mediumtext", "comment" => "page data"], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"], + ], + "indexes" => [ + "PRIMARY" => ["url", "guessing", "oembed"], + "created" => ["created"], + ] + ], + "participation" => [ + "comment" => "Storage for participation messages from Diaspora", + "fields" => [ + "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""], + "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""], + "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""], + "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["iid", "server"], + "cid" => ["cid"], + "fid" => ["fid"] + ] + ], + "pconfig" => [ + "comment" => "personal (per user) configuration storage", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""], + "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""], + "v" => ["type" => "mediumtext", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"], + ] + ], + "permissionset" => [ + "comment" => "", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"], + "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"], + "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"], + "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"], + "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"], + ] + ], + "photo" => [ + "comment" => "photo storage", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], + "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"], + "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"], + "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"], + "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"], + "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "desc" => ["type" => "text", "comment" => ""], + "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"], + "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"], + "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""], + "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"], + "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"], + "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"], + "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"], + "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"], + "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"], + "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""] + ], + "indexes" => [ + "PRIMARY" => ["id"], + "contactid" => ["contact-id"], + "uid_contactid" => ["uid", "contact-id"], + "uid_profile" => ["uid", "profile"], + "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"], + "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"], + "resource-id" => ["resource-id"], + ] + ], + "poll" => [ + "comment" => "Currently unused table for storing poll results", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + "q0" => ["type" => "text", "comment" => ""], + "q1" => ["type" => "text", "comment" => ""], + "q2" => ["type" => "text", "comment" => ""], + "q3" => ["type" => "text", "comment" => ""], + "q4" => ["type" => "text", "comment" => ""], + "q5" => ["type" => "text", "comment" => ""], + "q6" => ["type" => "text", "comment" => ""], + "q7" => ["type" => "text", "comment" => ""], + "q8" => ["type" => "text", "comment" => ""], + "q9" => ["type" => "text", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uid" => ["uid"], + ] + ], + "poll_result" => [ + "comment" => "data for polls - currently unused", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]], + "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "poll_id" => ["poll_id"], + ] + ], + "process" => [ + "comment" => "Currently running system processes", + "fields" => [ + "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""], + "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["pid"], + "command" => ["command"], + ] + ], + "profile" => [ + "comment" => "user profiles data", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], + "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"], + "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"], + "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"], + "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"], + "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"], + "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""], + "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "hometown" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""], + "marital" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "with" => ["type" => "text", "comment" => ""], + "howlong" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "sexual" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "politic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "religion" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "pub_keywords" => ["type" => "text", "comment" => ""], + "prv_keywords" => ["type" => "text", "comment" => ""], + "likes" => ["type" => "text", "comment" => ""], + "dislikes" => ["type" => "text", "comment" => ""], + "about" => ["type" => "text", "comment" => ""], + "summary" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "music" => ["type" => "text", "comment" => ""], + "book" => ["type" => "text", "comment" => ""], + "tv" => ["type" => "text", "comment" => ""], + "film" => ["type" => "text", "comment" => ""], + "interest" => ["type" => "text", "comment" => ""], + "romance" => ["type" => "text", "comment" => ""], + "work" => ["type" => "text", "comment" => ""], + "education" => ["type" => "text", "comment" => ""], + "contact" => ["type" => "text", "comment" => ""], + "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"], + "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uid_is-default" => ["uid", "is-default"], + "pub_keywords" => ["FULLTEXT", "pub_keywords"], + ] + ], + "profile_check" => [ + "comment" => "DFRN remote auth use", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"], + "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + ] + ], + "push_subscriber" => [ + "comment" => "Used for OStatus: Contains feed subscribers", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"], + "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"], + "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"], + "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"], + "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "next_try" => ["next_try"], + ] + ], + "register" => [ + "comment" => "registrations requiring admin approval", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""], + "note" => ["type" => "text", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + ] + ], + "search" => [ + "comment" => "", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uid" => ["uid"], + ] + ], + "session" => [ + "comment" => "web session storage", + "fields" => [ + "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""], + "data" => ["type" => "text", "comment" => ""], + "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "sid" => ["sid(64)"], + "expire" => ["expire"], + ] + ], + "sign" => [ + "comment" => "Diaspora signatures", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"], + "signed_text" => ["type" => "mediumtext", "comment" => ""], + "signature" => ["type" => "text", "comment" => ""], + "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "iid" => ["UNIQUE", "iid"], + ] + ], + "term" => [ + "comment" => "item taxonomy (categories, tags, etc.) table", + "fields" => [ + "tid" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""], + "oid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""], + "otype" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + ], + "indexes" => [ + "PRIMARY" => ["tid"], + "term_type" => ["term(64)", "type"], + "oid_otype_type_term" => ["oid", "otype", "type", "term(32)"], + "uid_otype_type_term_global_created" => ["uid", "otype", "type", "term(32)", "global", "created"], + "uid_otype_type_url" => ["uid", "otype", "type", "url(64)"], + "guid" => ["guid(64)"], + ] + ], + "thread" => [ + "comment" => "Thread related data", + "fields" => [ + "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], + "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""], + "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"], + "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], + "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"], + "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""], + "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""], + "bookmark" => ["type" => "boolean", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["iid"], + "uid_network_commented" => ["uid", "network", "commented"], + "uid_network_received" => ["uid", "network", "received"], + "uid_contactid_commented" => ["uid", "contact-id", "commented"], + "uid_contactid_received" => ["uid", "contact-id", "received"], + "contactid" => ["contact-id"], + "ownerid" => ["owner-id"], + "authorid" => ["author-id"], + "uid_received" => ["uid", "received"], + "uid_commented" => ["uid", "commented"], + "uid_wall_received" => ["uid", "wall", "received"], + "private_wall_origin_commented" => ["private", "wall", "origin", "commented"], + ] + ], + "tokens" => [ + "comment" => "OAuth usage", + "fields" => [ + "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""], + "secret" => ["type" => "text", "comment" => ""], + "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"]], + "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""], + "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + ] + ], + "user" => [ + "comment" => "The local users", + "fields" => [ + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], + "comment" => "The parent user that has full control about this user"], + "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"], + "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"], + "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"], + "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"], + "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"], + "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"], + "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"], + "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"], + "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"], + "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"], + "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"], + "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"], + "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"], + "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"], + "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"], + "spubkey" => ["type" => "text", "comment" => ""], + "sprvkey" => ["type" => "text", "comment" => ""], + "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"], + "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"], + "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"], + "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"], + "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"], + "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"], + "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""], + "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"], + "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"], + "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"], + "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"], + "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""], + "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"], + "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"], + "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"], + "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], + "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"], + "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"], + "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"], + "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"], + "openidserver" => ["type" => "text", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["uid"], + "nickname" => ["nickname(32)"], + ] + ], + "userd" => [ + "comment" => "Deleted usernames", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "username" => ["username(32)"], + ] + ], + "user-contact" => [ + "comment" => "User specific public contact data", + "fields" => [ + "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"], + "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"], + "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"], + "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"] + ], + "indexes" => [ + "PRIMARY" => ["uid", "cid"] + ] + ], + "user-item" => [ + "comment" => "User specific item data", + "fields" => [ + "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"], + "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"], + "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"], + "pinned" => ["type" => "boolean", "comment" => "The item is pinned on the profile page"] + ], + "indexes" => [ + "PRIMARY" => ["uid", "iid"] + ] + ], + "worker-ipc" => [ + "comment" => "Inter process communication between the frontend and the worker", + "fields" => [ + "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""], + "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"], + ], + "indexes" => [ + "PRIMARY" => ["key"], + ], + "engine" => "MEMORY", + ], + "workerqueue" => [ + "comment" => "Background tasks queue entries", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"], + "parameter" => ["type" => "mediumtext", "comment" => "Task command"], + "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"], + "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"], + "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"], + "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"], + "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"], + "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "done_parameter" => ["done", "parameter(64)"], + "done_executed" => ["done", "executed"], + "done_priority_created" => ["done", "priority", "created"], + "done_priority_next_try" => ["done", "priority", "next_try"], + "done_pid_next_try" => ["done", "pid", "next_try"], + "done_pid_priority_created" => ["done", "pid", "priority", "created"] + ] + ], + "storage" => [ + "comment" => "Data stored by Database storage backend", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"], + "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"] + ], + "indexes" => [ + "PRIMARY" => ["id"] + ] + ] +]; + diff --git a/static/routes.config.php.sic b/static/routes.config.php.sic new file mode 100644 index 0000000000..339860afe6 --- /dev/null +++ b/static/routes.config.php.sic @@ -0,0 +1,236 @@ + [ Module::class , [ HTTPMethod(s) ] ] +* - 'group' => [ 'route' => [ Module::class, [ HTTPMethod(s) ] ] +* +* It's possible to create recursive groups +*/ +return [ + '/' => [Module\Home::class, [R::GET]], + + '/.well-known' => [ + '/host-meta' => [Module\WellKnown\HostMeta::class, [R::GET]], + '/nodeinfo[/1.0]' => [Module\NodeInfo::class, [R::GET]], + '/webfinger' => [Module\Xrd::class, [R::GET]], + '/x-social-relay' => [Module\WellKnown\XSocialRelay::class, [R::GET]], + ], + + '/2fa' => [ + '[/]' => [Module\TwoFactor\Verify::class, [R::GET, R::POST]], + '/recovery' => [Module\TwoFactor\Recovery::class, [R::GET, R::POST]], + ], + + '/admin' => [ + '[/]' => [Module\Admin\Summary::class, [R::GET]], + + '/addons' => [Module\Admin\Addons\Index::class, [R::GET, R::POST]], + '/addons/{addon}' => [Module\Admin\Addons\Details::class, [R::GET, R::POST]], + + + '/blocklist/contact' => [Module\Admin\Blocklist\Contact::class, [R::GET, R::POST]], + '/blocklist/server' => [Module\Admin\Blocklist\Server::class, [R::GET, R::POST]], + + '/dbsync[/check]' => [Module\Admin\DBSync::class, [R::GET]], + '/dbsync/{update:\d+}' => [Module\Admin\DBSync::class, [R::GET]], + '/dbsync/mark/{update:\d+}' => [Module\Admin\DBSync::class, [R::GET]], + + '/features' => [Module\Admin\Features::class, [R::GET, R::POST]], + '/federation' => [Module\Admin\Federation::class, [R::GET]], + + '/item/delete' => [Module\Admin\Item\Delete::class, [R::GET, R::POST]], + '/item/source[/{guid}]' => [Module\Admin\Item\Source::class, [R::GET, R::POST]], + + '/logs/view' => [Module\Admin\Logs\View::class, [R::GET]], + '/logs' => [Module\Admin\Logs\Settings::class, [R::GET, R::POST]], + + '/phpinfo' => [Module\Admin\PhpInfo::class, [R::GET]], + + '/queue[/deferred]' => [Module\Admin\Queue::class, [R::GET]], + + '/site' => [Module\Admin\Site::class, [R::GET, R::POST]], + + '/themes' => [Module\Admin\Themes\Index::class, [R::GET, R::POST]], + '/themes/{theme}' => [Module\Admin\Themes\Details::class, [R::GET, R::POST]], + '/themes/{theme}/embed' => [Module\Admin\Themes\Embed::class, [R::GET, R::POST]], + + '/tos' => [Module\Admin\Tos::class, [R::GET, R::POST]], + + '/users[/{action}/{uid}]' => [Module\Admin\Users::class, [R::GET, R::POST]], + ], + '/amcd' => [Module\AccountManagementControlDocument::class, [R::GET]], + '/acctlink' => [Module\Acctlink::class, [R::GET]], + '/allfriends/{id:\d+}' => [Module\AllFriends::class, [R::GET]], + '/apps' => [Module\Apps::class, [R::GET]], + '/attach/{item:\d+}' => [Module\Attach::class, [R::GET]], + '/babel' => [Module\Debug\Babel::class, [R::GET, R::POST]], + '/bookmarklet' => [Module\Bookmarklet::class, [R::GET]], + '/compose[/{type}]' => [Module\Item\Compose::class, [R::GET, R::POST]], + + '/contact' => [ + '[/]' => [Module\Contact::class, [R::GET]], + '/{id:\d+}[/]' => [Module\Contact::class, [R::GET, R::POST]], + '/{id:\d+}/archive' => [Module\Contact::class, [R::GET]], + '/{id:\d+}/block' => [Module\Contact::class, [R::GET]], + '/{id:\d+}/conversations' => [Module\Contact::class, [R::GET]], + '/{id:\d+}/drop' => [Module\Contact::class, [R::GET]], + '/{id:\d+}/ignore' => [Module\Contact::class, [R::GET]], + '/{id:\d+}/posts' => [Module\Contact::class, [R::GET]], + '/{id:\d+}/update' => [Module\Contact::class, [R::GET]], + '/{id:\d+}/updateprofile' => [Module\Contact::class, [R::GET]], + '/archived' => [Module\Contact::class, [R::GET]], + '/batch' => [Module\Contact::class, [R::GET, R::POST]], + '/pending' => [Module\Contact::class, [R::GET]], + '/blocked' => [Module\Contact::class, [R::GET]], + '/hidden' => [Module\Contact::class, [R::GET]], + '/ignored' => [Module\Contact::class, [R::GET]], + '/hovercard' => [Module\Contact\Hovercard::class, [R::GET]], + ], + + '/credits' => [Module\Credits::class, [R::GET]], + '/delegation'=> [Module\Delegation::class, [R::GET, R::POST]], + '/dirfind' => [Module\Search\Directory::class, [R::GET]], + '/directory' => [Module\Directory::class, [R::GET]], + + '/feed' => [ + '/{nickname}' => [Module\Feed::class, [R::GET]], + '/{nickname}/posts' => [Module\Feed::class, [R::GET]], + '/{nickname}/comments' => [Module\Feed::class, [R::GET]], + '/{nickname}/replies' => [Module\Feed::class, [R::GET]], + '/{nickname}/activity' => [Module\Feed::class, [R::GET]], + ], + '/feedtest' => [Module\Debug\Feed::class, [R::GET]], + + '/fetch' => [ + '/post/{guid}' => [Module\Diaspora\Fetch::class, [R::GET]], + '/status_message/{guid}' => [Module\Diaspora\Fetch::class, [R::GET]], + '/reshare/{guid}' => [Module\Diaspora\Fetch::class, [R::GET]], + ], + '/filer[/{id:\d+}]' => [Module\Filer\SaveTag::class, [R::GET]], + '/filerm/{id:\d+}' => [Module\Filer\RemoveTag::class, [R::GET]], + '/follow_confirm' => [Module\FollowConfirm::class, [R::GET, R::POST]], + '/followers/{owner}' => [Module\Followers::class, [R::GET]], + '/following/{owner}' => [Module\Following::class, [R::GET]], + '/friendica[/json]' => [Module\Friendica::class, [R::GET]], + + '/group' => [ + '[/]' => [Module\Group::class, [R::GET, R::POST]], + '/{group:\d+}' => [Module\Group::class, [R::GET, R::POST]], + '/none' => [Module\Group::class, [R::GET, R::POST]], + '/new' => [Module\Group::class, [R::GET, R::POST]], + '/drop/{group:\d+}' => [Module\Group::class, [R::GET, R::POST]], + '/{group:\d+}/{contact:\d+}' => [Module\Group::class, [R::GET, R::POST]], + + '/{group:\d+}/add/{contact:\d+}' => [Module\Group::class, [R::GET, R::POST]], + '/{group:\d+}/remove/{contact:\d+}' => [Module\Group::class, [R::GET, R::POST]], + ], + '/hashtag' => [Module\Hashtag::class, [R::GET]], + '/home' => [Module\Home::class, [R::GET]], + '/help[/{doc:.+}]' => [Module\Help::class, [R::GET]], + '/inbox[/{nickname}]' => [Module\Inbox::class, [R::GET, R::POST]], + '/invite' => [Module\Invite::class, [R::GET, R::POST]], + + '/install' => [ + '[/]' => [Module\Install::class, [R::GET, R::POST]], + '/testrewrite' => [Module\Install::class, [R::GET]], + ], + + '/item' => [ + '/ignore/{id}' => [Module\Item\Ignore::class, [R::GET]], + ], + + '/like/{item:\d+}' => [Module\Like::class, [R::GET]], + '/localtime' => [Module\Debug\Localtime::class, [R::GET, R::POST]], + '/login' => [Module\Login::class, [R::GET, R::POST]], + '/logout' => [Module\Logout::class, [R::GET, R::POST]], + '/magic' => [Module\Magic::class, [R::GET]], + '/maintenance' => [Module\Maintenance::class, [R::GET]], + '/manifest' => [Module\Manifest::class, [R::GET]], + '/modexp/{nick}' => [Module\PublicRSAKey::class, [R::GET]], + '/newmember' => [Module\Welcome::class, [R::GET]], + '/nodeinfo/1.0' => [Module\NodeInfo::class, [R::GET]], + '/nogroup' => [Module\Group::class, [R::GET]], + + '/notify' => [ + '[/]' => [Module\Notifications\Notify::class, [R::GET]], + '/view/{id:\d+}' => [Module\Notifications\Notify::class, [R::GET]], + '/mark/all' => [Module\Notifications\Notify::class, [R::GET]], + ], + '/objects/{guid}' => [Module\Objects::class, [R::GET]], + + '/oembed' => [ + '/b2h' => [Module\Oembed::class, [R::GET]], + '/h2b' => [Module\Oembed::class, [R::GET]], + '/{hash}' => [Module\Oembed::class, [R::GET]], + ], + '/outbox/{owner}' => [Module\Outbox::class, [R::GET]], + '/owa' => [Module\Owa::class, [R::GET]], + '/opensearch' => [Module\OpenSearch::class, [R::GET]], + + '/photo' => [ + '/{name}' => [Module\Photo::class, [R::GET]], + '/{type}/{name}' => [Module\Photo::class, [R::GET]], + '/{type}/{customize}/{name}' => [Module\Photo::class, [R::GET]], + ], + + '/pinned/{item:\d+}' => [Module\Pinned::class, [R::GET]], + '/pretheme' => [Module\ThemeDetails::class, [R::GET]], + '/probe' => [Module\Debug\Probe::class, [R::GET]], + + '/profile' => [ + '/{nickname}' => [Module\Profile::class, [R::GET]], + '/{nickname}/{to:\d{4}-\d{2}-\d{2}}/{from:\d{4}-\d{2}-\d{2}}' => [Module\Profile::class, [R::GET]], + '/{nickname}/contacts[/{type}]' => [Module\Profile\Contacts::class, [R::GET]], + '/{profile:\d+}/view' => [Module\Profile::class, [R::GET]], + ], + + '/proxy' => [ + '[/]' => [Module\Proxy::class, [R::GET]], + '/{url}' => [Module\Proxy::class, [R::GET]], + '/{sub1}/{url}' => [Module\Proxy::class, [R::GET]], + '/{sub1}/{sub2}/{url}' => [Module\Proxy::class, [R::GET]], + ], + + '/search' => [ + '[/]' => [Module\Search\Index::class, [R::GET]], + '/acl' => [Module\Search\Acl::class, [R::GET, R::POST]], + '/saved/add' => [Module\Search\Saved::class, [R::GET]], + '/saved/remove' => [Module\Search\Saved::class, [R::GET]], + ], + + '/receive' => [ + '/public' => [Module\Diaspora\Receive::class, [R::POST]], + '/users/{guid}' => [Module\Diaspora\Receive::class, [R::POST]], + ], + + '/settings' => [ + '/2fa' => [ + '[/]' => [Module\Settings\TwoFactor\Index::class, [R::GET, R::POST]], + '/recovery' => [Module\Settings\TwoFactor\Recovery::class, [R::GET, R::POST]], + '/app_specific' => [Module\Settings\TwoFactor\AppSpecific::class, [R::GET, R::POST]], + '/verify' => [Module\Settings\TwoFactor\Verify::class, [R::GET, R::POST]], + ], + '/delegation[/{action}/{user_id}]' => [Module\Settings\Delegation::class, [R::GET, R::POST]], + '/userexport[/{action}]' => [Module\Settings\UserExport::class, [R::GET, R::POST]], + ], + + '/randprof' => [Module\RandomProfile::class, [R::GET]], + '/register' => [Module\Register::class, [R::GET, R::POST]], + '/robots.txt' => [Module\RobotsTxt::class, [R::GET]], + '/rsd.xml' => [Module\ReallySimpleDiscovery::class, [R::GET]], + '/smilies[/json]' => [Module\Smilies::class, [R::GET]], + '/statistics.json' => [Module\Statistics::class, [R::GET]], + '/starred/{item:\d+}' => [Module\Starred::class, [R::GET]], + '/toggle_mobile' => [Module\ToggleMobile::class, [R::GET]], + '/tos' => [Module\Tos::class, [R::GET]], + '/view/theme/{theme}/style.pcss' => [Module\Theme::class, [R::GET]], + '/viewsrc/{item:\d+}' => [Module\Debug\ItemBody::class, [R::GET]], + '/webfinger' => [Module\Debug\WebFinger::class, [R::GET]], + '/xrd' => [Module\Xrd::class, [R::GET]], +]; From 3a9bbd6be7f956b7acf45053cdc8fefb5e5c704b Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Nov 2019 21:51:47 +0000 Subject: [PATCH 06/10] Remove falsely added files --- static/dbstructure.config.php.sic | 1439 ----------------------------- static/routes.config.php.sic | 236 ----- 2 files changed, 1675 deletions(-) delete mode 100755 static/dbstructure.config.php.sic delete mode 100644 static/routes.config.php.sic diff --git a/static/dbstructure.config.php.sic b/static/dbstructure.config.php.sic deleted file mode 100755 index 65e0b26a6a..0000000000 --- a/static/dbstructure.config.php.sic +++ /dev/null @@ -1,1439 +0,0 @@ -" => [ - * "comment" => "Description of the table", - * "fields" => [ - * "" => [ - * "type" => "{()} ", - * "not null" => 0|1, - * {"extra" => "auto_increment",} - * {"default" => "",} - * {"default" => NULL_DATE,} (for datetime fields) - * {"primary" => "1",} - * {"relation" => ["" => ""],} - * "comment" => "Description of the fields" - * ], - * ... - * ], - * "indexes" => [ - * "PRIMARY" => ["", ...], - * "" => [{"UNIQUE",} "{()}", ...] - * ... - * ], - * ], - * - * If you need to make any change, make sure to increment the DB_UPDATE_VERSION constant value below. - * - */ - -use Friendica\Database\DBA; - -if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1324); -} - -return [ - "2fa_app_specific_password" => [ - "comment" => "Two-factor app-specific _password", - "fields" => [ - "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"], - "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"], - "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"], - "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"], - "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uid_description" => ["uid", "description(190)"], - ] - ], - "2fa_recovery_codes" => [ - "comment" => "Two-factor authentication recovery codes", - "fields" => [ - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"], - "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"], - "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"], - "used" => ["type" => "datetime", "comment" => "Datetime the code was used"], - ], - "indexes" => [ - "PRIMARY" => ["uid", "code"] - ] - ], - "addon" => [ - "comment" => "registered addons", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""], - "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"], - "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"], - "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"], - "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"], - "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"], - "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "name" => ["UNIQUE", "name"], - ] - ], - "apcontact" => [ - "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation", - "fields" => [ - "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"], - "uuid" => ["type" => "varchar(255)", "comment" => ""], - "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""], - "following" => ["type" => "varchar(255)", "comment" => ""], - "followers" => ["type" => "varchar(255)", "comment" => ""], - "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""], - "outbox" => ["type" => "varchar(255)", "comment" => ""], - "sharedinbox" => ["type" => "varchar(255)", "comment" => ""], - "manually-approve" => ["type" => "boolean", "comment" => ""], - "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "name" => ["type" => "varchar(255)", "comment" => ""], - "about" => ["type" => "text", "comment" => ""], - "photo" => ["type" => "varchar(255)", "comment" => ""], - "addr" => ["type" => "varchar(255)", "comment" => ""], - "alias" => ["type" => "varchar(255)", "comment" => ""], - "pubkey" => ["type" => "text", "comment" => ""], - "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"], - "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"], - "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""] - ], - "indexes" => [ - "PRIMARY" => ["url"], - "addr" => ["addr(32)"], - "alias" => ["alias(190)"], - "url" => ["followers(190)"] - ] - ], - "attach" => [ - "comment" => "file attachments", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], - "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"], - "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"], - "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"], - "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"], - "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"], - "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"], - "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"], - "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"], - "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"], - "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"], - "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"], - "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - ] - ], - "auth_codes" => [ - "comment" => "OAuth usage", - "fields" => [ - "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""], - "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"], - "comment" => ""], - "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""], - "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""], - "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - ] - ], - "cache" => [ - "comment" => "Stores temporary data", - "fields" => [ - "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"], - "v" => ["type" => "mediumtext", "comment" => "cached serialized value"], - "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"], - "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"], - ], - "indexes" => [ - "PRIMARY" => ["k"], - "k_expires" => ["k", "expires"], - ] - ], - "challenge" => [ - "comment" => "", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - ] - ], - "clients" => [ - "comment" => "OAuth usage", - "fields" => [ - "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""], - "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""], - "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""], - "name" => ["type" => "text", "comment" => ""], - "icon" => ["type" => "text", "comment" => ""], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - ], - "indexes" => [ - "PRIMARY" => ["client_id"], - ] - ], - "config" => [ - "comment" => "main configuration storage", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""], - "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""], - "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""], - "v" => ["type" => "mediumtext", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "cat_k" => ["UNIQUE", "cat", "k"], - ] - ], - "contact" => [ - "comment" => "contact table", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"], - "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"], - "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"], - "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"], - "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"], - "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"], - "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"], - "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""], - "about" => ["type" => "text", "comment" => ""], - "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"], - "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""], - "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"], - "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"], - "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"], - "site-pubkey" => ["type" => "text", "comment" => ""], - "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"], - "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"], - "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "request" => ["type" => "varchar(255)", "comment" => ""], - "notify" => ["type" => "varchar(255)", "comment" => ""], - "poll" => ["type" => "varchar(255)", "comment" => ""], - "confirm" => ["type" => "varchar(255)", "comment" => ""], - "poco" => ["type" => "varchar(255)", "comment" => ""], - "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"], - "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"], - "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"], - "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"], - "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"], - "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"], - "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"], - "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"], - "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"], - "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""], - "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""], - "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"], - "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""], - "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"], - "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"], - "baseurl" => ["type" => "varchar(255)", "default" => "", "comment" => "baseurl of the contact"], - "reason" => ["type" => "text", "comment" => ""], - "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""], - "info" => ["type" => "mediumtext", "comment" => ""], - "profile-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""], - "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""], - "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uid_name" => ["uid", "name(190)"], - "self_uid" => ["self", "uid"], - "alias_uid" => ["alias(32)", "uid"], - "pending_uid" => ["pending", "uid"], - "blocked_uid" => ["blocked", "uid"], - "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"], - "uid_network_batch" => ["uid", "network", "batch(64)"], - "addr_uid" => ["addr(32)", "uid"], - "nurl_uid" => ["nurl(32)", "uid"], - "nick_uid" => ["nick(32)", "uid"], - "dfrn-id" => ["dfrn-id(64)"], - "issued-id" => ["issued-id(64)"], - ] - ], - "conv" => [ - "comment" => "private messages", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"], - "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], - "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"], - "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"], - "subject" => ["type" => "text", "comment" => "subject of initial message"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uid" => ["uid"], - ] - ], - "conversation" => [ - "comment" => "Raw data and structure information for messages", - "fields" => [ - "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"], - "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"], - "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"], - "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"], - "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"], - "source" => ["type" => "mediumtext", "comment" => "Original source"], - "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"], - ], - "indexes" => [ - "PRIMARY" => ["item-uri"], - "conversation-uri" => ["conversation-uri"], - "received" => ["received"], - ] - ], - "diaspora-interaction" => [ - "comment" => "Signed Diaspora Interaction", - "fields" => [ - "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"], - "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"] - ], - "indexes" => [ - "PRIMARY" => ["uri-id"] - ] - ], - "event" => [ - "comment" => "Events", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], - "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"], - "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"], - "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"], - "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"], - "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"], - "summary" => ["type" => "text", "comment" => "short description or title of the event"], - "desc" => ["type" => "text", "comment" => "event description"], - "location" => ["type" => "text", "comment" => "event location"], - "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"], - "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"], - "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"], - "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"], - "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"], - "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"], - "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"], - "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uid_start" => ["uid", "start"], - ] - ], - "fcontact" => [ - "comment" => "Diaspora compatible contacts - used in the Diaspora implementation", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"], - "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""], - "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "pubkey" => ["type" => "text", "comment" => ""], - "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "addr" => ["addr(32)"], - "url" => ["UNIQUE", "url(190)"], - ] - ], - "fsuggest" => [ - "comment" => "friend suggestion stuff", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""], - "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "note" => ["type" => "text", "comment" => ""], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - ] - ], - "gcign" => [ - "comment" => "contacts ignored by friend suggestions", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"], - "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uid" => ["uid"], - "gcid" => ["gcid"], - ] - ], - "gcontact" => [ - "comment" => "global contacts", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"], - "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"], - "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"], - "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"], - "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""], - "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""], - "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""], - "archive_date" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""], - "archived" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "about" => ["type" => "text", "comment" => ""], - "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"], - "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""], - "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""], - "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"], - "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""], - "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"], - "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"], - "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"], - "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "notify" => ["type" => "varchar(255)", "comment" => ""], - "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "nurl" => ["UNIQUE", "nurl(190)"], - "name" => ["name(64)"], - "nick" => ["nick(32)"], - "addr" => ["addr(64)"], - "hide_network_updated" => ["hide", "network", "updated"], - "updated" => ["updated"], - ] - ], - "glink" => [ - "comment" => "'friends of friends' linkages derived from poco", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""], - "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""], - "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"], - "gcid" => ["gcid"], - ] - ], - "group" => [ - "comment" => "privacy groups, group info", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], - "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"], - "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"], - "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uid" => ["uid"], - ] - ], - "group_member" => [ - "comment" => "privacy groups, member info", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"], - "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "contactid" => ["contact-id"], - "gid_contactid" => ["UNIQUE", "gid", "contact-id"], - ] - ], - "gserver" => [ - "comment" => "Global servers", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "info" => ["type" => "text", "comment" => ""], - "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""], - "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"], - "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""], - "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"], - "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""], - "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""], - "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "nurl" => ["UNIQUE", "nurl(190)"], - ] - ], - "gserver-tag" => [ - "comment" => "Tags that the server has subscribed", - "fields" => [ - "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1", - "comment" => "The id of the gserver"], - "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"], - ], - "indexes" => [ - "PRIMARY" => ["gserver-id", "tag"], - "tag" => ["tag"], - ] - ], - "hook" => [ - "comment" => "addon hook registry", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"], - "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"], - "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"], - "priority" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => "not yet implemented - can be used to sort conflicts in hook handling by calling handlers in priority order"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "hook_file_function" => ["UNIQUE", "hook", "file", "function"], - ] - ], - "inbox-status" => [ - "comment" => "Status of ActivityPub inboxes", - "fields" => [ - "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"], - "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"], - "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"], - "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"], - "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"], - "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"] - ], - "indexes" => [ - "PRIMARY" => ["url"] - ] - ], - "intro" => [ - "comment" => "", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""], - "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""], - "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "note" => ["type" => "text", "comment" => ""], - "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""], - "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - ] - ], - "item" => [ - "comment" => "Structure for all posts", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]], - "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"], - "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"], - "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"], - "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id of the parent to this item if it is a reply of some form; otherwise this must be set to the id of this item"], - "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"], - "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"], - "thr-parent" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "If the parent of this item is not the top-level item in the conversation, the uri of the immediate parent; otherwise set to parent-uri"], - "thr-parent-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."], - "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"], - "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"], - "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"], - "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date that something in the conversation changed, indicating clients should fetch the conversation again"], - "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"], - "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the owner of this item"], - "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the author of this item"], - "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"], - "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"], - "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"], - "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "distribution is restricted"], - "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"], - // User specific fields. Eventually they will move to user-item - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"], - "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"], - "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"], - "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"], - "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"], - "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"], - "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"], - "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "psid" => ["type" => "int unsigned", "relation" => ["permissionset" => "id"], "comment" => "ID of the permission set of this post"], - // It has to be decided whether these fields belong to the user or the structure - "resource-id" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type"], - "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"], - // Could possibly be replaced by the "attach" table? - "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"], - // Deprecated fields. Will be removed in upcoming versions - "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"], - "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"], - "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"], - "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"], - "postopts" => ["type" => "text", "comment" => "Deprecated"], - "inform" => ["type" => "mediumtext", "comment" => "Deprecated"], - "type" => ["type" => "varchar(20)", "comment" => "Deprecated"], - "bookmark" => ["type" => "boolean", "comment" => "Deprecated"], - "file" => ["type" => "mediumtext", "comment" => "Deprecated"], - "location" => ["type" => "varchar(255)", "comment" => "Deprecated"], - "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"], - "tag" => ["type" => "mediumtext", "comment" => "Deprecated"], - "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"], - "title" => ["type" => "varchar(255)", "comment" => "Deprecated"], - "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"], - "body" => ["type" => "mediumtext", "comment" => "Deprecated"], - "app" => ["type" => "varchar(255)", "comment" => "Deprecated"], - "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"], - "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"], - "object" => ["type" => "text", "comment" => "Deprecated"], - "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"], - "target" => ["type" => "text", "comment" => "Deprecated"], - "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"], - "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"], - "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"], - "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"], - "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"], - "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"], - "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"], - "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "guid" => ["guid(191)"], - "uri" => ["uri(191)"], - "parent" => ["parent"], - "parent-uri" => ["parent-uri(191)"], - "extid" => ["extid(191)"], - "uid_id" => ["uid", "id"], - "uid_contactid_id" => ["uid", "contact-id", "id"], - "uid_received" => ["uid", "received"], - "uid_commented" => ["uid", "commented"], - "uid_unseen_contactid" => ["uid", "unseen", "contact-id"], - "uid_network_received" => ["uid", "network", "received"], - "uid_network_commented" => ["uid", "network", "commented"], - "uid_thrparent" => ["uid", "thr-parent(190)"], - "uid_parenturi" => ["uid", "parent-uri(190)"], - "uid_contactid_received" => ["uid", "contact-id", "received"], - "authorid_received" => ["author-id", "received"], - "ownerid" => ["owner-id"], - "contact-id" => ["contact-id"], - "uid_uri" => ["uid", "uri(190)"], - "resource-id" => ["resource-id"], - "deleted_changed" => ["deleted", "changed"], - "uid_wall_changed" => ["uid", "wall", "changed"], - "uid_eventid" => ["uid", "event-id"], - "icid" => ["icid"], - "iaid" => ["iaid"], - "psid_wall" => ["psid", "wall"], - ] - ], - "item-activity" => [ - "comment" => "Activities for items", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]], - "uri" => ["type" => "varchar(255)", "comment" => ""], - "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"], - "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"], - "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""] - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uri-hash" => ["UNIQUE", "uri-hash"], - "uri" => ["uri(191)"], - "uri-id" => ["uri-id"] - ] - ], - "item-content" => [ - "comment" => "Content for all posts", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]], - "uri" => ["type" => "varchar(255)", "comment" => ""], - "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"], - "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"], - "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"], - "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "body" => ["type" => "mediumtext", "comment" => "item body content"], - "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"], - "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"], - "language" => ["type" => "text", "comment" => "Language information about this post"], - "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"], - "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""], - "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"], - "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"], - "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"], - "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"], - "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"], - "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"], - "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"] - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"], - "uri" => ["uri(191)"], - "plink" => ["plink(191)"], - "uri-id" => ["uri-id"] - ] - ], - "item-delivery-data" => [ - "comment" => "Delivery data for items", - "fields" => [ - "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"], - "postopts" => ["type" => "text", "comment" => "External post connectors add their network name to this comma-separated string to identify that they should be delivered to these networks during delivery"], - "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"], - "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"], - "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"], - "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"], - "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"], - "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"], - "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"], - "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"], - "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"], - ], - "indexes" => [ - "PRIMARY" => ["iid"], - ] - ], - "item-uri" => [ - "comment" => "URI and GUID for items", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"], - "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"], - "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"] - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uri" => ["UNIQUE", "uri"], - "guid" => ["guid"] - ] - ], - "locks" => [ - "comment" => "", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""], - "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"], - "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "name_expires" => ["name", "expires"] - ] - ], - "mail" => [ - "comment" => "private messages", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], - "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"], - "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"], - "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"], - "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"], - "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"], - "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"], - "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "body" => ["type" => "mediumtext", "comment" => ""], - "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"], - "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"], - "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uid_seen" => ["uid", "seen"], - "convid" => ["convid"], - "uri" => ["uri(64)"], - "parent-uri" => ["parent-uri(64)"], - "contactid" => ["contact-id(32)"], - ] - ], - "mailacct" => [ - "comment" => "Mail account data for fetching mails", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""], - "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "pass" => ["type" => "text", "comment" => ""], - "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - ] - ], - "manage" => [ - "comment" => "table of accounts that can manage each other", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uid_mid" => ["UNIQUE", "uid", "mid"], - ] - ], - "notify" => [ - "comment" => "notifications", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""], - "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "msg" => ["type" => "mediumtext", "comment" => ""], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], - "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"], - "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""], - "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""], - "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""], - "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"], - "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"] - ], - "indexes" => [ - "PRIMARY" => ["id"], - "hash_uid" => ["hash", "uid"], - "seen_uid_date" => ["seen", "uid", "date"], - "uid_date" => ["uid", "date"], - "uid_type_link" => ["uid", "type", "link(190)"], - ] - ], - "notify-threads" => [ - "comment" => "", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""], - "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], - "comment" => ""], - "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], - "comment" => "User id"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - ] - ], - "oembed" => [ - "comment" => "cache for OEmbed queries", - "fields" => [ - "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"], - "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"], - "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"], - ], - "indexes" => [ - "PRIMARY" => ["url", "maxwidth"], - "created" => ["created"], - ] - ], - "openwebauth-token" => [ - "comment" => "Store OpenWebAuth token to verify contacts", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"], - "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"], - "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - ] - ], - "parsed_url" => [ - "comment" => "cache for 'parse_url' queries", - "fields" => [ - "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"], - "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"], - "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"], - "content" => ["type" => "mediumtext", "comment" => "page data"], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"], - ], - "indexes" => [ - "PRIMARY" => ["url", "guessing", "oembed"], - "created" => ["created"], - ] - ], - "participation" => [ - "comment" => "Storage for participation messages from Diaspora", - "fields" => [ - "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""], - "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""], - "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""], - "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["iid", "server"], - "cid" => ["cid"], - "fid" => ["fid"] - ] - ], - "pconfig" => [ - "comment" => "personal (per user) configuration storage", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""], - "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""], - "v" => ["type" => "mediumtext", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"], - ] - ], - "permissionset" => [ - "comment" => "", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"], - "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"], - "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"], - "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"], - "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"], - ] - ], - "photo" => [ - "comment" => "photo storage", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], - "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"], - "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"], - "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"], - "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"], - "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "desc" => ["type" => "text", "comment" => ""], - "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"], - "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"], - "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""], - "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"], - "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"], - "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"], - "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"], - "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"], - "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"], - "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""] - ], - "indexes" => [ - "PRIMARY" => ["id"], - "contactid" => ["contact-id"], - "uid_contactid" => ["uid", "contact-id"], - "uid_profile" => ["uid", "profile"], - "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"], - "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"], - "resource-id" => ["resource-id"], - ] - ], - "poll" => [ - "comment" => "Currently unused table for storing poll results", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - "q0" => ["type" => "text", "comment" => ""], - "q1" => ["type" => "text", "comment" => ""], - "q2" => ["type" => "text", "comment" => ""], - "q3" => ["type" => "text", "comment" => ""], - "q4" => ["type" => "text", "comment" => ""], - "q5" => ["type" => "text", "comment" => ""], - "q6" => ["type" => "text", "comment" => ""], - "q7" => ["type" => "text", "comment" => ""], - "q8" => ["type" => "text", "comment" => ""], - "q9" => ["type" => "text", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uid" => ["uid"], - ] - ], - "poll_result" => [ - "comment" => "data for polls - currently unused", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]], - "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "poll_id" => ["poll_id"], - ] - ], - "process" => [ - "comment" => "Currently running system processes", - "fields" => [ - "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""], - "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["pid"], - "command" => ["command"], - ] - ], - "profile" => [ - "comment" => "user profiles data", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"], - "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"], - "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"], - "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"], - "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"], - "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"], - "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""], - "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "hometown" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""], - "marital" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "with" => ["type" => "text", "comment" => ""], - "howlong" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "sexual" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "politic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "religion" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "pub_keywords" => ["type" => "text", "comment" => ""], - "prv_keywords" => ["type" => "text", "comment" => ""], - "likes" => ["type" => "text", "comment" => ""], - "dislikes" => ["type" => "text", "comment" => ""], - "about" => ["type" => "text", "comment" => ""], - "summary" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "music" => ["type" => "text", "comment" => ""], - "book" => ["type" => "text", "comment" => ""], - "tv" => ["type" => "text", "comment" => ""], - "film" => ["type" => "text", "comment" => ""], - "interest" => ["type" => "text", "comment" => ""], - "romance" => ["type" => "text", "comment" => ""], - "work" => ["type" => "text", "comment" => ""], - "education" => ["type" => "text", "comment" => ""], - "contact" => ["type" => "text", "comment" => ""], - "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"], - "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uid_is-default" => ["uid", "is-default"], - "pub_keywords" => ["FULLTEXT", "pub_keywords"], - ] - ], - "profile_check" => [ - "comment" => "DFRN remote auth use", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"], - "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - ] - ], - "push_subscriber" => [ - "comment" => "Used for OStatus: Contains feed subscribers", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"], - "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"], - "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"], - "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"], - "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "next_try" => ["next_try"], - ] - ], - "register" => [ - "comment" => "registrations requiring admin approval", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""], - "note" => ["type" => "text", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - ] - ], - "search" => [ - "comment" => "", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "uid" => ["uid"], - ] - ], - "session" => [ - "comment" => "web session storage", - "fields" => [ - "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""], - "data" => ["type" => "text", "comment" => ""], - "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "sid" => ["sid(64)"], - "expire" => ["expire"], - ] - ], - "sign" => [ - "comment" => "Diaspora signatures", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"], - "signed_text" => ["type" => "mediumtext", "comment" => ""], - "signature" => ["type" => "text", "comment" => ""], - "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "iid" => ["UNIQUE", "iid"], - ] - ], - "term" => [ - "comment" => "item taxonomy (categories, tags, etc.) table", - "fields" => [ - "tid" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""], - "oid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""], - "otype" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - ], - "indexes" => [ - "PRIMARY" => ["tid"], - "term_type" => ["term(64)", "type"], - "oid_otype_type_term" => ["oid", "otype", "type", "term(32)"], - "uid_otype_type_term_global_created" => ["uid", "otype", "type", "term(32)", "global", "created"], - "uid_otype_type_url" => ["uid", "otype", "type", "url(64)"], - "guid" => ["guid(64)"], - ] - ], - "thread" => [ - "comment" => "Thread related data", - "fields" => [ - "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], - "comment" => "sequential ID"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""], - "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"], - "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"], - "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""], - "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""], - "bookmark" => ["type" => "boolean", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["iid"], - "uid_network_commented" => ["uid", "network", "commented"], - "uid_network_received" => ["uid", "network", "received"], - "uid_contactid_commented" => ["uid", "contact-id", "commented"], - "uid_contactid_received" => ["uid", "contact-id", "received"], - "contactid" => ["contact-id"], - "ownerid" => ["owner-id"], - "authorid" => ["author-id"], - "uid_received" => ["uid", "received"], - "uid_commented" => ["uid", "commented"], - "uid_wall_received" => ["uid", "wall", "received"], - "private_wall_origin_commented" => ["private", "wall", "origin", "commented"], - ] - ], - "tokens" => [ - "comment" => "OAuth usage", - "fields" => [ - "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""], - "secret" => ["type" => "text", "comment" => ""], - "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"]], - "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""], - "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - ] - ], - "user" => [ - "comment" => "The local users", - "fields" => [ - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], - "comment" => "The parent user that has full control about this user"], - "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"], - "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"], - "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"], - "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"], - "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"], - "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"], - "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"], - "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"], - "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"], - "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"], - "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"], - "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"], - "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"], - "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"], - "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"], - "spubkey" => ["type" => "text", "comment" => ""], - "sprvkey" => ["type" => "text", "comment" => ""], - "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"], - "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"], - "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"], - "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"], - "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"], - "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"], - "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""], - "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"], - "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"], - "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"], - "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"], - "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""], - "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"], - "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"], - "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"], - "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""], - "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"], - "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"], - "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"], - "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"], - "openidserver" => ["type" => "text", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["uid"], - "nickname" => ["nickname(32)"], - ] - ], - "userd" => [ - "comment" => "Deleted usernames", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], - "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "username" => ["username(32)"], - ] - ], - "user-contact" => [ - "comment" => "User specific public contact data", - "fields" => [ - "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"], - "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"], - "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"], - "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"] - ], - "indexes" => [ - "PRIMARY" => ["uid", "cid"] - ] - ], - "user-item" => [ - "comment" => "User specific item data", - "fields" => [ - "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"], - "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"], - "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"], - "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"], - "pinned" => ["type" => "boolean", "comment" => "The item is pinned on the profile page"] - ], - "indexes" => [ - "PRIMARY" => ["uid", "iid"] - ] - ], - "worker-ipc" => [ - "comment" => "Inter process communication between the frontend and the worker", - "fields" => [ - "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""], - "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"], - ], - "indexes" => [ - "PRIMARY" => ["key"], - ], - "engine" => "MEMORY", - ], - "workerqueue" => [ - "comment" => "Background tasks queue entries", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"], - "parameter" => ["type" => "mediumtext", "comment" => "Task command"], - "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"], - "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"], - "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"], - "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"], - "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"], - "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "done_parameter" => ["done", "parameter(64)"], - "done_executed" => ["done", "executed"], - "done_priority_created" => ["done", "priority", "created"], - "done_priority_next_try" => ["done", "priority", "next_try"], - "done_pid_next_try" => ["done", "pid", "next_try"], - "done_pid_priority_created" => ["done", "pid", "priority", "created"] - ] - ], - "storage" => [ - "comment" => "Data stored by Database storage backend", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"], - "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"] - ], - "indexes" => [ - "PRIMARY" => ["id"] - ] - ] -]; - diff --git a/static/routes.config.php.sic b/static/routes.config.php.sic deleted file mode 100644 index 339860afe6..0000000000 --- a/static/routes.config.php.sic +++ /dev/null @@ -1,236 +0,0 @@ - [ Module::class , [ HTTPMethod(s) ] ] -* - 'group' => [ 'route' => [ Module::class, [ HTTPMethod(s) ] ] -* -* It's possible to create recursive groups -*/ -return [ - '/' => [Module\Home::class, [R::GET]], - - '/.well-known' => [ - '/host-meta' => [Module\WellKnown\HostMeta::class, [R::GET]], - '/nodeinfo[/1.0]' => [Module\NodeInfo::class, [R::GET]], - '/webfinger' => [Module\Xrd::class, [R::GET]], - '/x-social-relay' => [Module\WellKnown\XSocialRelay::class, [R::GET]], - ], - - '/2fa' => [ - '[/]' => [Module\TwoFactor\Verify::class, [R::GET, R::POST]], - '/recovery' => [Module\TwoFactor\Recovery::class, [R::GET, R::POST]], - ], - - '/admin' => [ - '[/]' => [Module\Admin\Summary::class, [R::GET]], - - '/addons' => [Module\Admin\Addons\Index::class, [R::GET, R::POST]], - '/addons/{addon}' => [Module\Admin\Addons\Details::class, [R::GET, R::POST]], - - - '/blocklist/contact' => [Module\Admin\Blocklist\Contact::class, [R::GET, R::POST]], - '/blocklist/server' => [Module\Admin\Blocklist\Server::class, [R::GET, R::POST]], - - '/dbsync[/check]' => [Module\Admin\DBSync::class, [R::GET]], - '/dbsync/{update:\d+}' => [Module\Admin\DBSync::class, [R::GET]], - '/dbsync/mark/{update:\d+}' => [Module\Admin\DBSync::class, [R::GET]], - - '/features' => [Module\Admin\Features::class, [R::GET, R::POST]], - '/federation' => [Module\Admin\Federation::class, [R::GET]], - - '/item/delete' => [Module\Admin\Item\Delete::class, [R::GET, R::POST]], - '/item/source[/{guid}]' => [Module\Admin\Item\Source::class, [R::GET, R::POST]], - - '/logs/view' => [Module\Admin\Logs\View::class, [R::GET]], - '/logs' => [Module\Admin\Logs\Settings::class, [R::GET, R::POST]], - - '/phpinfo' => [Module\Admin\PhpInfo::class, [R::GET]], - - '/queue[/deferred]' => [Module\Admin\Queue::class, [R::GET]], - - '/site' => [Module\Admin\Site::class, [R::GET, R::POST]], - - '/themes' => [Module\Admin\Themes\Index::class, [R::GET, R::POST]], - '/themes/{theme}' => [Module\Admin\Themes\Details::class, [R::GET, R::POST]], - '/themes/{theme}/embed' => [Module\Admin\Themes\Embed::class, [R::GET, R::POST]], - - '/tos' => [Module\Admin\Tos::class, [R::GET, R::POST]], - - '/users[/{action}/{uid}]' => [Module\Admin\Users::class, [R::GET, R::POST]], - ], - '/amcd' => [Module\AccountManagementControlDocument::class, [R::GET]], - '/acctlink' => [Module\Acctlink::class, [R::GET]], - '/allfriends/{id:\d+}' => [Module\AllFriends::class, [R::GET]], - '/apps' => [Module\Apps::class, [R::GET]], - '/attach/{item:\d+}' => [Module\Attach::class, [R::GET]], - '/babel' => [Module\Debug\Babel::class, [R::GET, R::POST]], - '/bookmarklet' => [Module\Bookmarklet::class, [R::GET]], - '/compose[/{type}]' => [Module\Item\Compose::class, [R::GET, R::POST]], - - '/contact' => [ - '[/]' => [Module\Contact::class, [R::GET]], - '/{id:\d+}[/]' => [Module\Contact::class, [R::GET, R::POST]], - '/{id:\d+}/archive' => [Module\Contact::class, [R::GET]], - '/{id:\d+}/block' => [Module\Contact::class, [R::GET]], - '/{id:\d+}/conversations' => [Module\Contact::class, [R::GET]], - '/{id:\d+}/drop' => [Module\Contact::class, [R::GET]], - '/{id:\d+}/ignore' => [Module\Contact::class, [R::GET]], - '/{id:\d+}/posts' => [Module\Contact::class, [R::GET]], - '/{id:\d+}/update' => [Module\Contact::class, [R::GET]], - '/{id:\d+}/updateprofile' => [Module\Contact::class, [R::GET]], - '/archived' => [Module\Contact::class, [R::GET]], - '/batch' => [Module\Contact::class, [R::GET, R::POST]], - '/pending' => [Module\Contact::class, [R::GET]], - '/blocked' => [Module\Contact::class, [R::GET]], - '/hidden' => [Module\Contact::class, [R::GET]], - '/ignored' => [Module\Contact::class, [R::GET]], - '/hovercard' => [Module\Contact\Hovercard::class, [R::GET]], - ], - - '/credits' => [Module\Credits::class, [R::GET]], - '/delegation'=> [Module\Delegation::class, [R::GET, R::POST]], - '/dirfind' => [Module\Search\Directory::class, [R::GET]], - '/directory' => [Module\Directory::class, [R::GET]], - - '/feed' => [ - '/{nickname}' => [Module\Feed::class, [R::GET]], - '/{nickname}/posts' => [Module\Feed::class, [R::GET]], - '/{nickname}/comments' => [Module\Feed::class, [R::GET]], - '/{nickname}/replies' => [Module\Feed::class, [R::GET]], - '/{nickname}/activity' => [Module\Feed::class, [R::GET]], - ], - '/feedtest' => [Module\Debug\Feed::class, [R::GET]], - - '/fetch' => [ - '/post/{guid}' => [Module\Diaspora\Fetch::class, [R::GET]], - '/status_message/{guid}' => [Module\Diaspora\Fetch::class, [R::GET]], - '/reshare/{guid}' => [Module\Diaspora\Fetch::class, [R::GET]], - ], - '/filer[/{id:\d+}]' => [Module\Filer\SaveTag::class, [R::GET]], - '/filerm/{id:\d+}' => [Module\Filer\RemoveTag::class, [R::GET]], - '/follow_confirm' => [Module\FollowConfirm::class, [R::GET, R::POST]], - '/followers/{owner}' => [Module\Followers::class, [R::GET]], - '/following/{owner}' => [Module\Following::class, [R::GET]], - '/friendica[/json]' => [Module\Friendica::class, [R::GET]], - - '/group' => [ - '[/]' => [Module\Group::class, [R::GET, R::POST]], - '/{group:\d+}' => [Module\Group::class, [R::GET, R::POST]], - '/none' => [Module\Group::class, [R::GET, R::POST]], - '/new' => [Module\Group::class, [R::GET, R::POST]], - '/drop/{group:\d+}' => [Module\Group::class, [R::GET, R::POST]], - '/{group:\d+}/{contact:\d+}' => [Module\Group::class, [R::GET, R::POST]], - - '/{group:\d+}/add/{contact:\d+}' => [Module\Group::class, [R::GET, R::POST]], - '/{group:\d+}/remove/{contact:\d+}' => [Module\Group::class, [R::GET, R::POST]], - ], - '/hashtag' => [Module\Hashtag::class, [R::GET]], - '/home' => [Module\Home::class, [R::GET]], - '/help[/{doc:.+}]' => [Module\Help::class, [R::GET]], - '/inbox[/{nickname}]' => [Module\Inbox::class, [R::GET, R::POST]], - '/invite' => [Module\Invite::class, [R::GET, R::POST]], - - '/install' => [ - '[/]' => [Module\Install::class, [R::GET, R::POST]], - '/testrewrite' => [Module\Install::class, [R::GET]], - ], - - '/item' => [ - '/ignore/{id}' => [Module\Item\Ignore::class, [R::GET]], - ], - - '/like/{item:\d+}' => [Module\Like::class, [R::GET]], - '/localtime' => [Module\Debug\Localtime::class, [R::GET, R::POST]], - '/login' => [Module\Login::class, [R::GET, R::POST]], - '/logout' => [Module\Logout::class, [R::GET, R::POST]], - '/magic' => [Module\Magic::class, [R::GET]], - '/maintenance' => [Module\Maintenance::class, [R::GET]], - '/manifest' => [Module\Manifest::class, [R::GET]], - '/modexp/{nick}' => [Module\PublicRSAKey::class, [R::GET]], - '/newmember' => [Module\Welcome::class, [R::GET]], - '/nodeinfo/1.0' => [Module\NodeInfo::class, [R::GET]], - '/nogroup' => [Module\Group::class, [R::GET]], - - '/notify' => [ - '[/]' => [Module\Notifications\Notify::class, [R::GET]], - '/view/{id:\d+}' => [Module\Notifications\Notify::class, [R::GET]], - '/mark/all' => [Module\Notifications\Notify::class, [R::GET]], - ], - '/objects/{guid}' => [Module\Objects::class, [R::GET]], - - '/oembed' => [ - '/b2h' => [Module\Oembed::class, [R::GET]], - '/h2b' => [Module\Oembed::class, [R::GET]], - '/{hash}' => [Module\Oembed::class, [R::GET]], - ], - '/outbox/{owner}' => [Module\Outbox::class, [R::GET]], - '/owa' => [Module\Owa::class, [R::GET]], - '/opensearch' => [Module\OpenSearch::class, [R::GET]], - - '/photo' => [ - '/{name}' => [Module\Photo::class, [R::GET]], - '/{type}/{name}' => [Module\Photo::class, [R::GET]], - '/{type}/{customize}/{name}' => [Module\Photo::class, [R::GET]], - ], - - '/pinned/{item:\d+}' => [Module\Pinned::class, [R::GET]], - '/pretheme' => [Module\ThemeDetails::class, [R::GET]], - '/probe' => [Module\Debug\Probe::class, [R::GET]], - - '/profile' => [ - '/{nickname}' => [Module\Profile::class, [R::GET]], - '/{nickname}/{to:\d{4}-\d{2}-\d{2}}/{from:\d{4}-\d{2}-\d{2}}' => [Module\Profile::class, [R::GET]], - '/{nickname}/contacts[/{type}]' => [Module\Profile\Contacts::class, [R::GET]], - '/{profile:\d+}/view' => [Module\Profile::class, [R::GET]], - ], - - '/proxy' => [ - '[/]' => [Module\Proxy::class, [R::GET]], - '/{url}' => [Module\Proxy::class, [R::GET]], - '/{sub1}/{url}' => [Module\Proxy::class, [R::GET]], - '/{sub1}/{sub2}/{url}' => [Module\Proxy::class, [R::GET]], - ], - - '/search' => [ - '[/]' => [Module\Search\Index::class, [R::GET]], - '/acl' => [Module\Search\Acl::class, [R::GET, R::POST]], - '/saved/add' => [Module\Search\Saved::class, [R::GET]], - '/saved/remove' => [Module\Search\Saved::class, [R::GET]], - ], - - '/receive' => [ - '/public' => [Module\Diaspora\Receive::class, [R::POST]], - '/users/{guid}' => [Module\Diaspora\Receive::class, [R::POST]], - ], - - '/settings' => [ - '/2fa' => [ - '[/]' => [Module\Settings\TwoFactor\Index::class, [R::GET, R::POST]], - '/recovery' => [Module\Settings\TwoFactor\Recovery::class, [R::GET, R::POST]], - '/app_specific' => [Module\Settings\TwoFactor\AppSpecific::class, [R::GET, R::POST]], - '/verify' => [Module\Settings\TwoFactor\Verify::class, [R::GET, R::POST]], - ], - '/delegation[/{action}/{user_id}]' => [Module\Settings\Delegation::class, [R::GET, R::POST]], - '/userexport[/{action}]' => [Module\Settings\UserExport::class, [R::GET, R::POST]], - ], - - '/randprof' => [Module\RandomProfile::class, [R::GET]], - '/register' => [Module\Register::class, [R::GET, R::POST]], - '/robots.txt' => [Module\RobotsTxt::class, [R::GET]], - '/rsd.xml' => [Module\ReallySimpleDiscovery::class, [R::GET]], - '/smilies[/json]' => [Module\Smilies::class, [R::GET]], - '/statistics.json' => [Module\Statistics::class, [R::GET]], - '/starred/{item:\d+}' => [Module\Starred::class, [R::GET]], - '/toggle_mobile' => [Module\ToggleMobile::class, [R::GET]], - '/tos' => [Module\Tos::class, [R::GET]], - '/view/theme/{theme}/style.pcss' => [Module\Theme::class, [R::GET]], - '/viewsrc/{item:\d+}' => [Module\Debug\ItemBody::class, [R::GET]], - '/webfinger' => [Module\Debug\WebFinger::class, [R::GET]], - '/xrd' => [Module\Xrd::class, [R::GET]], -]; From aecac2cb5463cad58f582f96655ed53a330bb278 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Nov 2019 22:01:45 +0000 Subject: [PATCH 07/10] Readded removed comments --- src/BaseModule.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/BaseModule.php b/src/BaseModule.php index 2b9ebdb14e..503a22de35 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -34,6 +34,8 @@ abstract class BaseModule extends BaseObject */ public static function rawContent(array $parameters = []) { + // echo ''; + // exit; } /** @@ -60,6 +62,8 @@ abstract class BaseModule extends BaseObject */ public static function post(array $parameters = []) { + // $a = self::getApp(); + // $a->internalRedirect('module'); } /** From a5b5f0e4551b081c875dad683c48dd0cd0a9bd86 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Nov 2019 22:03:02 +0000 Subject: [PATCH 08/10] removed space --- src/BaseModule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BaseModule.php b/src/BaseModule.php index 503a22de35..be53289e52 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -63,7 +63,7 @@ abstract class BaseModule extends BaseObject public static function post(array $parameters = []) { // $a = self::getApp(); - // $a->internalRedirect('module'); + // $a->internalRedirect('module'); } /** From 7adc3460b367d3f8c0299416d4f91873bb9e449a Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Nov 2019 22:13:33 +0000 Subject: [PATCH 09/10] Exceptions --- src/Module/Starred.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Module/Starred.php b/src/Module/Starred.php index dbda9f1076..74b75a42b0 100644 --- a/src/Module/Starred.php +++ b/src/Module/Starred.php @@ -13,18 +13,18 @@ class Starred extends BaseModule public static function rawContent(array $parameters = []) { if (!local_user()) { - exit(); + throw new \Friendica\Network\HTTPException\NotFoundException(); } if (empty($parameters['item'])) { - exit; - } else { - $itemId = intval($parameters['item']); + throw new \Friendica\Network\HTTPException\NotFoundException(); } + $itemId = intval($parameters['item']); + $item = Item::selectFirstForUser(local_user(), ['starred'], ['uid' => local_user(), 'id' => $itemId]); if (empty($item)) { - exit(); + throw new \Friendica\Network\HTTPException\NotFoundException(); } $starred = !(bool)$item['starred']; From 02c43f283ea6998935ec93e35e4d2593e884593a Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 Nov 2019 22:28:12 +0000 Subject: [PATCH 10/10] Changed exceptions --- src/Module/Starred.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Module/Starred.php b/src/Module/Starred.php index 74b75a42b0..c1fa4c3b8b 100644 --- a/src/Module/Starred.php +++ b/src/Module/Starred.php @@ -13,11 +13,11 @@ class Starred extends BaseModule public static function rawContent(array $parameters = []) { if (!local_user()) { - throw new \Friendica\Network\HTTPException\NotFoundException(); + throw new \Friendica\Network\HTTPException\ForbiddenException(); } if (empty($parameters['item'])) { - throw new \Friendica\Network\HTTPException\NotFoundException(); + throw new \Friendica\Network\HTTPException\BadRequestException(); } $itemId = intval($parameters['item']);