diff --git a/classes/Attention.php b/classes/Attention.php
index c704b7257d..2d0d19efc9 100644
--- a/classes/Attention.php
+++ b/classes/Attention.php
@@ -51,7 +51,6 @@ class Attention extends Managed_DataObject
'attention_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
),
'indexes' => array(
- 'attention_notice_id_idx' => array('notice_id'),
'attention_profile_id_idx' => array('profile_id'),
),
);
diff --git a/classes/Avatar.php b/classes/Avatar.php
index c0d4eeae92..5860a3f5fc 100644
--- a/classes/Avatar.php
+++ b/classes/Avatar.php
@@ -52,9 +52,6 @@ class Avatar extends Managed_DataObject
'foreign keys' => array(
'avatar_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
),
- 'indexes' => array(
- 'avatar_profile_id_idx' => array('profile_id'),
- ),
);
}
diff --git a/classes/File_thumbnail.php b/classes/File_thumbnail.php
index eca27d6015..191282c938 100644
--- a/classes/File_thumbnail.php
+++ b/classes/File_thumbnail.php
@@ -51,7 +51,6 @@ class File_thumbnail extends Managed_DataObject
),
'primary key' => array('file_id', 'width', 'height'),
'indexes' => array(
- 'file_thumbnail_file_id_idx' => array('file_id'),
'file_thumbnail_urlhash_idx' => array('urlhash'),
),
'foreign keys' => array(
diff --git a/classes/File_to_post.php b/classes/File_to_post.php
index 2ac6a686b0..8906a0e6e2 100644
--- a/classes/File_to_post.php
+++ b/classes/File_to_post.php
@@ -50,8 +50,7 @@ class File_to_post extends Managed_DataObject
'file_to_post_post_id_fkey' => array('notice', array('post_id' => 'id')),
),
'indexes' => array(
- 'file_id_idx' => array('file_id'),
- 'post_id_idx' => array('post_id'),
+ 'file_to_post_post_id_idx' => array('post_id'),
),
);
}
diff --git a/classes/Foreign_link.php b/classes/Foreign_link.php
index e2d5220da5..3d0dd8ccbd 100644
--- a/classes/Foreign_link.php
+++ b/classes/Foreign_link.php
@@ -60,12 +60,9 @@ class Foreign_link extends Managed_DataObject
'primary key' => array('user_id', 'foreign_id', 'service'),
'foreign keys' => array(
'foreign_link_user_id_fkey' => array('user', array('user_id' => 'id')),
- 'foreign_link_foreign_id_fkey' => array('foreign_user', array('foreign_id' => 'id', 'service' => 'service')),
+ 'foreign_link_foreign_id_service_fkey' => array('foreign_user', array('foreign_id' => 'id', 'service' => 'service')),
'foreign_link_service_fkey' => array('foreign_service', array('service' => 'id')),
),
- 'indexes' => array(
- 'foreign_user_user_id_idx' => array('user_id'),
- ),
);
}
diff --git a/classes/Foreign_subscription.php b/classes/Foreign_subscription.php
index aba0bf4b2d..32d9dff1e9 100644
--- a/classes/Foreign_subscription.php
+++ b/classes/Foreign_subscription.php
@@ -47,12 +47,11 @@ class Foreign_subscription extends Managed_DataObject
'primary key' => array('service', 'subscriber', 'subscribed'),
'foreign keys' => array(
'foreign_subscription_service_fkey' => array('foreign_service', array('service' => 'id')),
- 'foreign_subscription_subscriber_fkey' => array('foreign_user', array('subscriber' => 'id', 'service' => 'service')),
- 'foreign_subscription_subscribed_fkey' => array('foreign_user', array('subscribed' => 'id', 'service' => 'service')),
+ 'foreign_subscription_subscriber_service_fkey' => array('foreign_user', array('subscriber' => 'id', 'service' => 'service')),
+ 'foreign_subscription_subscribed_service_fkey' => array('foreign_user', array('subscribed' => 'id', 'service' => 'service')),
),
'indexes' => array(
- 'foreign_subscription_subscriber_idx' => array('service', 'subscriber'),
- 'foreign_subscription_subscribed_idx' => array('service', 'subscribed'),
+ 'foreign_subscription_service_subscribed_idx' => array('service', 'subscribed'),
),
);
}
diff --git a/classes/Group_member.php b/classes/Group_member.php
index b10e196003..66af1a6579 100644
--- a/classes/Group_member.php
+++ b/classes/Group_member.php
@@ -56,8 +56,6 @@ class Group_member extends Managed_DataObject
'group_member_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
),
'indexes' => array(
- // @fixme probably we want a (profile_id, created) index here?
- 'group_member_profile_id_idx' => array('profile_id'),
'group_member_created_idx' => array('created'),
'group_member_profile_id_created_idx' => array('profile_id', 'created'),
'group_member_group_id_created_idx' => array('group_id', 'created'),
diff --git a/classes/Invitation.php b/classes/Invitation.php
index fa835fa6e3..2f992f3b3d 100644
--- a/classes/Invitation.php
+++ b/classes/Invitation.php
@@ -61,7 +61,7 @@ class Invitation extends Managed_DataObject
'invitation_registered_user_id_fkey' => array('user', array('registered_user_id' => 'id')),
),
'indexes' => array(
- 'invitation_address_idx' => array('address', 'address_type'),
+ 'invitation_address_address_type_idx' => array('address', 'address_type'),
'invitation_user_id_idx' => array('user_id'),
'invitation_registered_user_id_idx' => array('registered_user_id'),
),
diff --git a/classes/Notice.php b/classes/Notice.php
index 96368fe5b4..5bd291c371 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -114,7 +114,7 @@ class Notice extends Managed_DataObject
'notice_object_type_idx' => array('object_type'),
'notice_verb_idx' => array('verb'),
'notice_url_idx' => array('url'), // Qvitter wants this
- 'notice_replyto_idx' => array('reply_to')
+ 'notice_reply_to_idx' => array('reply_to')
)
);
diff --git a/classes/Notice_prefs.php b/classes/Notice_prefs.php
index 0c213c090f..39ebe1c231 100644
--- a/classes/Notice_prefs.php
+++ b/classes/Notice_prefs.php
@@ -52,9 +52,6 @@ class Notice_prefs extends Managed_DataObject
'foreign keys' => array(
'notice_prefs_notice_id_fkey' => array('notice', array('notice_id' => 'id')),
),
- 'indexes' => array(
- 'notice_prefs_notice_id_idx' => array('notice_id'),
- ),
);
}
diff --git a/classes/Oauth_token_association.php b/classes/Oauth_token_association.php
index e976fe91c2..221acdcecd 100644
--- a/classes/Oauth_token_association.php
+++ b/classes/Oauth_token_association.php
@@ -65,9 +65,9 @@ class Oauth_token_association extends Managed_DataObject
),
'primary key' => array('profile_id', 'application_id', 'token'),
'foreign keys' => array(
- 'oauth_token_association_profile_fkey' => array('profile', array('profile_id' => 'id')),
- 'oauth_token_association_application_fkey' => array('oauth_application', array('application_id' => 'id')),
- )
+ 'oauth_token_association_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
+ 'oauth_token_association_application_id_fkey' => array('oauth_application', array('application_id' => 'id')),
+ ),
);
}
}
diff --git a/classes/Profile_list.php b/classes/Profile_list.php
index b41d13b84d..d9f331acf3 100644
--- a/classes/Profile_list.php
+++ b/classes/Profile_list.php
@@ -67,7 +67,6 @@ class Profile_list extends Managed_DataObject
'indexes' => array(
'profile_list_modified_idx' => array('modified'),
'profile_list_tag_idx' => array('tag'),
- 'profile_list_tagger_tag_idx' => array('tagger', 'tag'),
'profile_list_tagged_count_idx' => array('tagged_count'),
'profile_list_subscriber_count_idx' => array('subscriber_count'),
),
diff --git a/classes/Profile_prefs.php b/classes/Profile_prefs.php
index a149da3153..ff1e92dacf 100644
--- a/classes/Profile_prefs.php
+++ b/classes/Profile_prefs.php
@@ -51,9 +51,6 @@ class Profile_prefs extends Managed_DataObject
'foreign keys' => array(
'profile_prefs_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
),
- 'indexes' => array(
- 'profile_prefs_profile_id_idx' => array('profile_id'),
- ),
);
}
diff --git a/classes/Profile_tag_subscription.php b/classes/Profile_tag_subscription.php
index 8e002cba64..6e6261ce79 100644
--- a/classes/Profile_tag_subscription.php
+++ b/classes/Profile_tag_subscription.php
@@ -46,7 +46,7 @@ class Profile_tag_subscription extends Managed_DataObject
),
'primary key' => array('profile_tag_id', 'profile_id'),
'foreign keys' => array(
- 'profile_tag_subscription_profile_list_id_fkey' => array('profile_list', array('profile_tag_id' => 'id')),
+ 'profile_tag_subscription_profile_tag_id_fkey' => array('profile_list', array('profile_tag_id' => 'id')),
'profile_tag_subscription_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
),
'indexes' => array(
diff --git a/classes/Reply.php b/classes/Reply.php
index 754e0627c0..9baa0989c9 100644
--- a/classes/Reply.php
+++ b/classes/Reply.php
@@ -49,7 +49,6 @@ class Reply extends Managed_DataObject
'reply_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
),
'indexes' => array(
- 'reply_notice_id_idx' => array('notice_id'),
'reply_profile_id_idx' => array('profile_id'),
'reply_replied_id_idx' => array('replied_id'),
'reply_profile_id_modified_notice_id_idx' => array('profile_id', 'modified', 'notice_id')
diff --git a/classes/Subscription.php b/classes/Subscription.php
index 228d9412b8..da151b6f26 100644
--- a/classes/Subscription.php
+++ b/classes/Subscription.php
@@ -15,7 +15,7 @@
// along with GNU social. If not, see .
/**
- * @copyright 2008, 2009, StatusNet, Inc.
+ * @copyright 2008, 2009 StatusNet, Inc.
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*/
@@ -59,8 +59,8 @@ class Subscription extends Managed_DataObject
'subscription_uri_key' => array('uri'),
),
'indexes' => array(
- 'subscription_subscriber_idx' => array('subscriber', 'created'),
- 'subscription_subscribed_idx' => array('subscribed', 'created'),
+ 'subscription_subscriber_created_idx' => array('subscriber', 'created'),
+ 'subscription_subscribed_created_idx' => array('subscribed', 'created'),
'subscription_token_idx' => array('token'),
),
);
diff --git a/classes/Token.php b/classes/Token.php
index f02f977227..196379701c 100644
--- a/classes/Token.php
+++ b/classes/Token.php
@@ -55,7 +55,7 @@ class Token extends Managed_DataObject
),
'primary key' => array('consumer_key', 'tok'),
'foreign keys' => array(
- 'token_consumer_key_fkey' => array('consumer', array('consumer_key'=> 'consumer_key')),
+ 'token_consumer_key_fkey' => array('consumer', array('consumer_key' => 'consumer_key')),
),
);
}
diff --git a/classes/User_group.php b/classes/User_group.php
index 8b3c3200dd..226c0efb54 100644
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -88,7 +88,7 @@ class User_group extends Managed_DataObject
// when it's safe and everyone's run upgrade.php 'user_profile_id_key' => array('profile_id'),
),
'foreign keys' => array(
- 'user_group_id_fkey' => array('profile', array('profile_id' => 'id')),
+ 'user_group_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
),
'indexes' => array(
'user_group_nickname_idx' => array('nickname'),
diff --git a/classes/User_im_prefs.php b/classes/User_im_prefs.php
index d5fc9e2034..0e465ad2c4 100644
--- a/classes/User_im_prefs.php
+++ b/classes/User_im_prefs.php
@@ -59,7 +59,7 @@ class User_im_prefs extends Managed_DataObject
),
'primary key' => array('user_id', 'transport'),
'unique keys' => array(
- 'transport_screenname_key' => array('transport', 'screenname'),
+ 'user_im_prefs_transport_screenname_key' => array('transport', 'screenname'),
),
'foreign keys' => array(
'user_im_prefs_user_id_fkey' => array('user', array('user_id' => 'id')),
diff --git a/classes/User_username.php b/classes/User_username.php
index d78b9eade8..8007e8b90a 100644
--- a/classes/User_username.php
+++ b/classes/User_username.php
@@ -46,12 +46,12 @@ class User_username extends Managed_DataObject
'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
),
'primary key' => array('provider_name', 'username'),
- 'indexes' => array(
- 'user_id_idx' => array('user_id')
- ),
'foreign keys' => array(
'user_username_user_id_fkey' => array('user', array('user_id' => 'id')),
),
+ 'indexes' => array(
+ 'user_username_user_id_idx' => array('user_id'),
+ ),
);
}
diff --git a/lib/modules/Realtime/classes/Realtime_channel.php b/lib/modules/Realtime/classes/Realtime_channel.php
index 723fd5011f..00ca056fe0 100644
--- a/lib/modules/Realtime/classes/Realtime_channel.php
+++ b/lib/modules/Realtime/classes/Realtime_channel.php
@@ -90,7 +90,9 @@ class Realtime_channel extends Managed_DataObject
'description' => 'date this record was modified'],
],
'primary key' => ['channel_key'],
- 'unique keys' => ['realtime_channel_user_page_idx' => ['user_id', 'action', 'arg1', 'arg2']],
+ 'unique keys' => [
+ 'realtime_channel_user_id_action_arg1_arg2_key' => ['user_id', 'action', 'arg1', 'arg2'],
+ ],
'foreign keys' => [
'realtime_channel_user_id_fkey' => ['user', ['user_id' => 'id']],
],
diff --git a/modules/Favorite/classes/Fave.php b/modules/Favorite/classes/Fave.php
index e78b7db509..3a42c21ff4 100644
--- a/modules/Favorite/classes/Fave.php
+++ b/modules/Favorite/classes/Fave.php
@@ -48,8 +48,7 @@ class Fave extends Managed_DataObject
'fave_user_id_fkey' => array('profile', array('user_id' => 'id')), // note: formerly referenced notice.id, but we can now record remote users' favorites
),
'indexes' => array(
- 'fave_notice_id_idx' => array('notice_id'),
- 'fave_user_id_idx' => array('user_id', 'modified'),
+ 'fave_user_id_modified_idx' => array('user_id', 'modified'),
'fave_modified_idx' => array('modified'),
),
);
diff --git a/plugins/DirectMessage/classes/Message.php b/plugins/DirectMessage/classes/Message.php
index 1fe2ccc1a0..d7e7541e7b 100644
--- a/plugins/DirectMessage/classes/Message.php
+++ b/plugins/DirectMessage/classes/Message.php
@@ -28,7 +28,7 @@ defined('GNUSOCIAL') || die();
/**
* Table definition for message.
- *
+ *
* Since the new updates this class only has the necessary
* logic to upgrade te plugin.
*
@@ -84,24 +84,24 @@ class Message extends Managed_DataObject
'indexes' => array(
// @fixme these are really terrible indexes, since you can only sort on one of them at a time.
// looks like we really need a (to_profile, created) for inbox and a (from_profile, created) for outbox
- 'message_from_idx' => array('from_profile'),
- 'message_to_idx' => array('to_profile'),
+ 'message_from_profile_idx' => array('from_profile'),
+ 'message_to_profile_idx' => array('to_profile'),
'message_created_idx' => array('created'),
),
);
}
- function getFrom()
+ public function getFrom()
{
return Profile::getKV('id', $this->from_profile);
}
- function getTo()
+ public function getTo()
{
return Profile::getKV('id', $this->to_profile);
}
- function getSource()
+ public function getSource()
{
if (empty($this->source)) {
return false;
@@ -133,7 +133,7 @@ class Message extends Managed_DataObject
return $ns;
}
- function asActivity()
+ public function asActivity()
{
$act = new Activity();
diff --git a/plugins/EmailReminder/classes/Email_reminder.php b/plugins/EmailReminder/classes/Email_reminder.php
index 700a3aa20a..6f9f2d6aa3 100644
--- a/plugins/EmailReminder/classes/Email_reminder.php
+++ b/plugins/EmailReminder/classes/Email_reminder.php
@@ -135,7 +135,7 @@ class Email_reminder extends Managed_DataObject
),
'primary key' => array('type', 'code', 'days'),
'indexes' => array(
- 'sent_idx' => array('sent'),
+ 'email_reminder_sent_idx' => array('sent'),
),
);
}
diff --git a/plugins/Event/classes/Happening.php b/plugins/Event/classes/Happening.php
index 574efc8260..ecbd7f18b3 100644
--- a/plugins/Event/classes/Happening.php
+++ b/plugins/Event/classes/Happening.php
@@ -1,33 +1,30 @@
.
+
/**
* Data class for happenings
*
- * PHP version 5
- *
- * @category Data
- * @package StatusNet
- * @author Evan Prodromou
- * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
- * @link http://status.net/
- *
- * StatusNet - the distributed open-source microblogging tool
- * Copyright (C) 2011, StatusNet, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * @category Data
+ * @package GNUsocial
+ * @author Evan Prodromou
+ * @copyright 2011 StatusNet, Inc.
+ * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*/
-if (!defined('GNUSOCIAL')) { exit(1); }
+defined('GNUSOCIAL') || die();
/**
* Data class for happenings
@@ -37,13 +34,12 @@ if (!defined('GNUSOCIAL')) { exit(1); }
*
* "Happening" seemed good enough.
*
- * @category Event
- * @package StatusNet
- * @author Evan Prodromou
- * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
- * @link http://status.net/
+ * @category Event
+ * @package GNUsocial
+ * @author Evan Prodromou
+ * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*
- * @see Managed_DataObject
+ * @see Managed_DataObject
*/
class Happening extends Managed_DataObject
{
@@ -98,8 +94,10 @@ class Happening extends Managed_DataObject
'happening_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
'happening_uri_fkey' => array('notice', array('uri' => 'uri'))
),
- 'indexes' => array('happening_created_idx' => array('created'),
- 'happening_start_end_idx' => array('start_time', 'end_time')),
+ 'indexes' => array(
+ 'happening_created_idx' => array('created'),
+ 'happening_start_time_end_time_idx' => array('start_time', 'end_time'),
+ ),
);
}
@@ -129,25 +127,26 @@ class Happening extends Managed_DataObject
foreach ($actobj->extra as $extra) {
switch ($extra[0]) {
- case 'dtstart':
- $dtstart = $extra[2];
- case 'dtend':
- $dtend = $extra[2];
- break;
- case 'location':
- // location is optional
- $location = $extra[2];
- break;
- case 'url':
- // url is optional
- $url = $extra[2];
+ case 'dtstart':
+ $dtstart = $extra[2];
+ break;
+ case 'dtend':
+ $dtend = $extra[2];
+ break;
+ case 'location':
+ // location is optional
+ $location = $extra[2];
+ break;
+ case 'url':
+ // url is optional
+ $url = $extra[2];
}
}
- if(empty($dtstart)) {
+ if (empty($dtstart)) {
// TRANS: Exception thrown when has no start date
throw new Exception(_m('No start date for event.'));
}
- if(empty($dtend)) {
+ if (empty($dtend)) {
// TRANS: Exception thrown when has no end date
throw new Exception(_m('No end date for event.'));
}
@@ -211,7 +210,7 @@ class Happening extends Managed_DataObject
return Notice::getByKeys(array('uri'=>$this->getUri()));
}
- static function fromStored(Notice $stored)
+ public static function fromStored(Notice $stored)
{
if (!ActivityUtils::compareTypes($stored->getObjectType(), [self::OBJECT_TYPE])) {
throw new ServerException('Notice is not of type '.self::OBJECT_TYPE);
@@ -219,18 +218,20 @@ class Happening extends Managed_DataObject
return self::getByKeys(array('uri'=>$stored->getUri()));
}
- function getRSVPs()
+ public function getRSVPs()
{
return RSVP::forEvent($this);
}
- function getRSVP($profile)
+ public function getRSVP($profile)
{
- return RSVP::pkeyGet(array('profile_id' => $profile->getID(),
- 'event_uri' => $this->getUri()));
+ return RSVP::pkeyGet([
+ 'profile_id' => $profile->getID(),
+ 'event_uri' => $this->getUri(),
+ ]);
}
- static public function getObjectType()
+ public static function getObjectType()
{
return self::OBJECT_TYPE;
}
diff --git a/plugins/Event/classes/RSVP.php b/plugins/Event/classes/RSVP.php
index aaa850a258..653c482bea 100644
--- a/plugins/Event/classes/RSVP.php
+++ b/plugins/Event/classes/RSVP.php
@@ -1,44 +1,40 @@
.
+
/**
* Data class for event RSVPs
*
- * PHP version 5
- *
- * @category Data
- * @package StatusNet
- * @author Evan Prodromou
- * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
- * @link http://status.net/
- *
- * StatusNet - the distributed open-source microblogging tool
- * Copyright (C) 2011, StatusNet, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * @category Data
+ * @package GNUsocial
+ * @author Evan Prodromou
+ * @copyright 2011 StatusNet, Inc.
+ * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*/
-if (!defined('GNUSOCIAL')) { exit(1); }
+defined('GNUSOCIAL') || die();
/**
* Data class for event RSVPs
*
- * @category Event
- * @package StatusNet
- * @author Evan Prodromou
- * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
- * @link http://status.net/
+ * @category Event
+ * @package GNUsocial
+ * @author Evan Prodromou
+ * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*
- * @see Managed_DataObject
+ * @see Managed_DataObject
*/
class RSVP extends Managed_DataObject
{
@@ -83,7 +79,7 @@ class RSVP extends Managed_DataObject
'primary key' => array('id'),
'unique keys' => array(
'rsvp_uri_key' => array('uri'),
- 'rsvp_profile_event_key' => array('profile_id', 'event_uri'),
+ 'rsvp_profile_id_event_uri_key' => array('profile_id', 'event_uri'),
),
'foreign keys' => array(
'rsvp_event_uri_fkey' => array('happening', array('event_uri' => 'uri')),
@@ -93,7 +89,7 @@ class RSVP extends Managed_DataObject
);
}
- static public function beforeSchemaUpdate()
+ public static function beforeSchemaUpdate()
{
$table = strtolower(get_called_class());
$schema = Schema::get();
@@ -128,7 +124,7 @@ class RSVP extends Managed_DataObject
print "Resuming core schema upgrade...";
}
- static function saveActivityObject(Activity $act, Notice $stored)
+ public static function saveActivityObject(Activity $act, Notice $stored)
{
$target = Notice::getByKeys(array('uri'=>$act->target->id));
if (!ActivityUtils::compareTypes($target->getObjectType(), [ Happening::OBJECT_TYPE ])) {
@@ -138,9 +134,10 @@ class RSVP extends Managed_DataObject
// FIXME: Maybe we need some permission handling here, though I think it's taken care of in saveActivity?
try {
- $other = RSVP::getByKeys( [ 'profile_id' => $stored->getProfile()->getID(),
- 'event_uri' => $target->getUri(),
- ] );
+ $other = RSVP::getByKeys([
+ 'profile_id' => $stored->getProfile()->getID(),
+ 'event_uri' => $target->getUri(),
+ ]);
// TRANS: Client exception thrown when trying to save an already existing RSVP ("please respond").
throw new AlreadyFulfilledException(_m('RSVP already exists.'));
} catch (NoResultException $e) {
@@ -162,7 +159,7 @@ class RSVP extends Managed_DataObject
return $rsvp;
}
- static public function getObjectType()
+ public static function getObjectType()
{
return ActivityObject::ACTIVITY;
}
@@ -181,7 +178,7 @@ class RSVP extends Managed_DataObject
return $actobj;
}
- static function codeFor($verb)
+ public static function codeFor($verb)
{
switch (true) {
case ActivityUtils::compareVerbs($verb, [RSVP::POSITIVE]):
@@ -195,11 +192,11 @@ class RSVP extends Managed_DataObject
break;
default:
// TRANS: Exception thrown when requesting an undefined verb for RSVP.
- throw new Exception(sprintf(_m('Unknown verb "%s".'),$verb));
+ throw new Exception(sprintf(_m('Unknown verb "%s".'), $verb));
}
}
- static function verbFor($code)
+ public static function verbFor($code)
{
switch ($code) {
case 'Y':
@@ -235,18 +232,18 @@ class RSVP extends Managed_DataObject
return Notice::getByKeys(['uri' => $this->getUri()]);
}
- static function fromStored(Notice $stored)
+ public static function fromStored(Notice $stored)
{
return self::getByKeys(['uri' => $stored->getUri()]);
}
- static function byEventAndActor(Happening $event, Profile $actor)
+ public static function byEventAndActor(Happening $event, Profile $actor)
{
return self::getByKeys(['event_uri' => $event->getUri(),
'profile_id' => $actor->getID()]);
}
- static function forEvent(Happening $event)
+ public static function forEvent(Happening $event)
{
$keypart = sprintf('rsvp:for-event:%s', $event->getUri());
@@ -287,31 +284,35 @@ class RSVP extends Managed_DataObject
return $rsvps;
}
- function getProfile()
+ public function getProfile()
{
return Profile::getByID($this->profile_id);
}
- function getEvent()
+ public function getEvent()
{
return Happening::getByKeys(['uri' => $this->getEventUri()]);
}
- function asHTML()
+ public function asHTML()
{
- return self::toHTML($this->getProfile(),
- $this->getEvent(),
- $this->response);
+ return self::toHTML(
+ $this->getProfile(),
+ $this->getEvent(),
+ $this->response
+ );
}
- function asString()
+ public function asString()
{
- return self::toString($this->getProfile(),
- $this->getEvent(),
- $this->response);
+ return self::toString(
+ $this->getProfile(),
+ $this->getEvent(),
+ $this->response
+ );
}
- static function toHTML(Profile $profile, Happening $event, $response)
+ public static function toHTML(Profile $profile, Happening $event, $response)
{
$fmt = null;
@@ -337,7 +338,7 @@ class RSVP extends Managed_DataObject
default:
// TRANS: Exception thrown when requesting a user's RSVP status for a non-existing response code.
// TRANS: %s is the non-existing response code.
- throw new Exception(sprintf(_m('Unknown response code %s.'),$response));
+ throw new Exception(sprintf(_m('Unknown response code %s.'), $response));
}
if (empty($event)) {
@@ -350,14 +351,16 @@ class RSVP extends Managed_DataObject
$eventTitle = $event->title;
}
- return sprintf($fmt,
- htmlspecialchars($profile->getUrl()),
- htmlspecialchars($profile->getBestName()),
- htmlspecialchars($eventUrl),
- htmlspecialchars($eventTitle));
+ return sprintf(
+ $fmt,
+ htmlspecialchars($profile->getUrl()),
+ htmlspecialchars($profile->getBestName()),
+ htmlspecialchars($eventUrl),
+ htmlspecialchars($eventTitle)
+ );
}
- static function toString($profile, $event, $response)
+ public static function toString($profile, $event, $response)
{
$fmt = null;
@@ -380,7 +383,7 @@ class RSVP extends Managed_DataObject
default:
// TRANS: Exception thrown when requesting a user's RSVP status for a non-existing response code.
// TRANS: %s is the non-existing response code.
- throw new Exception(sprintf(_m('Unknown response code %s.'),$response));
+ throw new Exception(sprintf(_m('Unknown response code %s.'), $response));
break;
}
@@ -392,9 +395,11 @@ class RSVP extends Managed_DataObject
$eventTitle = $event->title;
}
- return sprintf($fmt,
- $profile->getBestName(),
- $eventTitle);
+ return sprintf(
+ $fmt,
+ $profile->getBestName(),
+ $eventTitle
+ );
}
public function delete($useWhere=false)
diff --git a/plugins/ExtendedProfile/classes/Profile_detail.php b/plugins/ExtendedProfile/classes/Profile_detail.php
index a766f20ac2..70dbce11da 100644
--- a/plugins/ExtendedProfile/classes/Profile_detail.php
+++ b/plugins/ExtendedProfile/classes/Profile_detail.php
@@ -1,25 +1,25 @@
.
+
/*
- * StatusNet - the distributed open-source microblogging tool
- * Copyright (C) 2011, StatusNet, Inc.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
+ * @copyright 1012 StatusNet, Inc.
+ * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*/
-if (!defined('STATUSNET')) {
- exit(1);
-}
+defined('GNUSOCIAL') || die();
/**
* DataObject class to store extended profile fields. Allows for storing
@@ -98,7 +98,7 @@ class Profile_detail extends Managed_DataObject
],
'primary key' => ['id'],
'unique keys' => [
- 'profile_detail_profile_id_field_name_value_index' => ['profile_id', 'field_name', 'value_index']
+ 'profile_detail_profile_id_field_name_value_index_key' => ['profile_id', 'field_name', 'value_index']
],
];
}
diff --git a/plugins/ModLog/classes/ModLog.php b/plugins/ModLog/classes/ModLog.php
index c315ff8f08..0c61f488d3 100644
--- a/plugins/ModLog/classes/ModLog.php
+++ b/plugins/ModLog/classes/ModLog.php
@@ -48,36 +48,49 @@ class ModLog extends Managed_DataObject
*/
public static function schemaDef()
{
- return array('description' => 'Log of moderation events',
- 'fields' => array(
- 'id' => array('type' => 'varchar',
- 'length' => 36,
- 'not null' => true,
- 'description' => 'unique event ID'),
- 'profile_id' => array('type' => 'int',
- 'not null' => true,
- 'description' => 'profile getting the role'),
- 'moderator_id' => array('type' => 'int',
- 'description' => 'profile granting or revoking the role'),
- 'role' => array('type' => 'varchar',
- 'length' => 32,
- 'not null' => true,
- 'description' => 'role granted or revoked'),
- 'is_grant' => array('type' => 'bool',
- 'default' => true,
- 'description' => 'Was this a grant or revocation of a role'),
- 'created' => array('type' => 'datetime',
- 'not null' => true,
- 'description' => 'date this record was created')
- ),
- 'primary key' => array('id'),
- 'foreign keys' => array(
- 'mod_log_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
- 'mod_log_moderator_id_fkey' => array('user', array('moderator_id' => 'id'))
- ),
- 'indexes' => array(
- 'mod_log_profile_id_created_idx' => array('profile_id', 'created'),
- ),
- );
+ return [
+ 'description' => 'Log of moderation events',
+ 'fields' => [
+ 'id' => [
+ 'type' => 'varchar',
+ 'length' => 36,
+ 'not null' => true,
+ 'description' => 'unique event ID',
+ ],
+ 'profile_id' => [
+ 'type' => 'int',
+ 'not null' => true,
+ 'description' => 'profile getting the role',
+ ],
+ 'moderator_id' => [
+ 'type' => 'int',
+ 'description' => 'profile granting or revoking the role',
+ ],
+ 'role' => [
+ 'type' => 'varchar',
+ 'length' => 32,
+ 'not null' => true,
+ 'description' => 'role granted or revoked',
+ ],
+ 'is_grant' => [
+ 'type' => 'bool',
+ 'default' => true,
+ 'description' => 'Was this a grant or revocation of a role',
+ ],
+ 'created' => [
+ 'type' => 'datetime',
+ 'not null' => true,
+ 'description' => 'date this record was created',
+ ],
+ ],
+ 'primary key' => ['id'],
+ 'foreign keys' => [
+ 'modlog_profile_id_fkey' => ['profile', ['profile_id' => 'id']],
+ 'modlog_moderator_id_fkey' => ['user', ['moderator_id' => 'id']],
+ ],
+ 'indexes' => [
+ 'modlog_profile_id_created_idx' => ['profile_id', 'created'],
+ ],
+ ];
}
}
diff --git a/plugins/Nodeinfo/classes/Usage_stats.php b/plugins/Nodeinfo/classes/Usage_stats.php
index 2bb87ebe93..eb069c8c38 100644
--- a/plugins/Nodeinfo/classes/Usage_stats.php
+++ b/plugins/Nodeinfo/classes/Usage_stats.php
@@ -53,9 +53,6 @@ class Usage_stats extends Managed_DataObject
'modified' => ['type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'],
],
'primary key' => ['type'],
- 'indexes' => [
- 'user_stats_idx' => ['type'],
- ],
];
}
diff --git a/plugins/OpenID/classes/User_openid_prefs.php b/plugins/OpenID/classes/User_openid_prefs.php
index 0d1d999ed8..454ed1c9b5 100644
--- a/plugins/OpenID/classes/User_openid_prefs.php
+++ b/plugins/OpenID/classes/User_openid_prefs.php
@@ -1,47 +1,40 @@
.
+
/**
- * StatusNet - the distributed open-source microblogging tool
- * Copyright (C) 2012, StatusNet, Inc.
- *
* User_openid_prefs.php
*
- * PHP version 5
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- *
* @category OpenID
- * @package StatusNet
+ * @package GNUsocial
* @author Evan Prodromou
* @copyright 2012 StatusNet, Inc.
- * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
- * @link http://status.net/
+ * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*/
-if (!defined('STATUSNET')) {
- exit(1);
-}
+defined('GNUSOCIAL') || die();
/**
* Store preferences for OpenID use in StatusNet
*
- * @category OpenID
- * @package StatusNet
- * @author Evan Prodromou
- * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
- * @link http://status.net/
+ * @category OpenID
+ * @package GNUsocial
+ * @author Evan Prodromou
+ * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*
- * @see DB_DataObject
+ * @see DB_DataObject
*/
class User_openid_prefs extends Managed_DataObject
@@ -84,10 +77,10 @@ class User_openid_prefs extends Managed_DataObject
'description' => 'date this record was modified',
],
],
- 'primary key' => ['user_id'],
- 'foreign keys' => ['user_openid_prefs_user_id_fkey' => ['user', ['user_id' => 'id']],
+ 'primary key' => ['user_id'],
+ 'foreign keys' => [
+ 'user_openid_prefs_user_id_fkey' => ['user', ['user_id' => 'id']],
],
- 'indexes' => [],
];
}
}
diff --git a/plugins/Poll/classes/Poll_response.php b/plugins/Poll/classes/Poll_response.php
index 91f6a7cf14..f17db51412 100644
--- a/plugins/Poll/classes/Poll_response.php
+++ b/plugins/Poll/classes/Poll_response.php
@@ -20,7 +20,7 @@
* @category PollPlugin
* @package GNUsocial
* @author Brion Vibber
- * @copyright 2011, StatusNet, Inc.
+ * @copyright 2011 StatusNet, Inc.
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*/
@@ -29,7 +29,7 @@ defined('GNUSOCIAL') || die();
/**
* For storing the poll options and such
*
- * @copyright 2011, StatusNet, Inc.
+ * @copyright 2011 StatusNet, Inc.
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
*
* @see DB_DataObject
@@ -65,7 +65,7 @@ class Poll_response extends Managed_DataObject
'poll_response_poll_id_profile_id_key' => array('poll_id', 'profile_id'),
),
'indexes' => array(
- 'poll_response_profile_id_poll_id_index' => array('profile_id', 'poll_id'),
+ 'poll_response_profile_id_poll_id_idx' => array('profile_id', 'poll_id'),
)
);
}
diff --git a/plugins/SearchSub/classes/SearchSub.php b/plugins/SearchSub/classes/SearchSub.php
index e74d60d3f0..3c97c36ab4 100644
--- a/plugins/SearchSub/classes/SearchSub.php
+++ b/plugins/SearchSub/classes/SearchSub.php
@@ -60,7 +60,7 @@ class SearchSub extends Managed_DataObject
),
'indexes' => array(
'searchsub_created_idx' => array('created'),
- 'searchsub_profile_id_tag_idx' => array('profile_id', 'search'),
+ 'searchsub_profile_id_search_idx' => array('profile_id', 'search'),
),
);
}
diff --git a/plugins/TwitterBridge/classes/Notice_to_status.php b/plugins/TwitterBridge/classes/Notice_to_status.php
index e1462a1962..7febad9e8a 100644
--- a/plugins/TwitterBridge/classes/Notice_to_status.php
+++ b/plugins/TwitterBridge/classes/Notice_to_status.php
@@ -64,7 +64,7 @@ class Notice_to_status extends Managed_DataObject
),
'primary key' => array('notice_id'),
'unique keys' => array(
- 'status_id_key' => array('status_id'),
+ 'notice_to_status_status_id_key' => array('status_id'),
),
'foreign keys' => array(
'notice_to_status_notice_id_fkey' => array('notice', array('notice_id' => 'id')),