The overloaded DB_DataObject function staticGet is now called getKV

I used this hacky sed-command (run it from your GNU Social root, or change the first grep's path to where it actually lies) to do a rough fix on all ::staticGet calls and rename them to ::getKV

   sed -i -s -e '/DataObject::staticGet/I!s/::staticGet/::getKV/Ig' $(grep -R ::staticGet `pwd`/* | grep -v -e '^extlib' | grep -v DataObject:: |grep -v "function staticGet"|cut -d: -f1 |sort |uniq)

If you're applying this, remember to change the Managed_DataObject and Memcached_DataObject function definitions of staticGet to getKV!

This might of course take some getting used to, or modification fo StatusNet plugins, but the result is that all the static calls (to staticGet) are now properly made without breaking PHP Strict Standards. Standards are there to be followed (and they caused some very bad confusion when used with get_called_class)

Reasonably any plugin or code that tests for the definition of 'GNUSOCIAL' or similar will take this change into consideration.
This commit is contained in:
Mikael Nordfeldth 2013-08-18 13:04:58 +02:00
parent e95f77d34c
commit 2a4dc77a63
346 changed files with 898 additions and 897 deletions

View File

@ -94,7 +94,7 @@ class AddpeopletagAction extends Action
$tagged_id = $this->arg('tagged');
$this->tagged = Profile::staticGet('id', $tagged_id);
$this->tagged = Profile::getKV('id', $tagged_id);
if (empty($this->tagged)) {
// TRANS: Client error displayed trying to perform an action related to a non-existing profile.
@ -103,7 +103,7 @@ class AddpeopletagAction extends Action
}
$id = $this->arg('peopletag_id');
$this->peopletag = Profile_list::staticGet('id', $id);
$this->peopletag = Profile_list::getKV('id', $id);
if (empty($this->peopletag)) {
// TRANS: Client error displayed trying to reference a non-existing list.
@ -130,7 +130,7 @@ class AddpeopletagAction extends Action
$this->peopletag->tag);
if (!$ptag) {
$user = User::staticGet('id', $id);
$user = User::getKV('id', $id);
if ($user) {
$this->clientError(
// TRANS: Client error displayed when an unknown error occurs when adding a user to a list.

View File

@ -62,7 +62,7 @@ class AllrssAction extends Rss10Action
{
parent::prepare($args);
$nickname = $this->trimmed('nickname');
$this->user = User::staticGet('nickname', $nickname);
$this->user = User::getKV('nickname', $nickname);
if (!$this->user) {
// TRANS: Client error when user not found for an rss related action.

View File

@ -69,7 +69,7 @@ class ApiconversationAction extends ApiAuthAction
throw new ClientException(_('No conversation ID.'));
}
$this->conversation = Conversation::staticGet('id', $convId);
$this->conversation = Conversation::getKV('id', $convId);
if (empty($this->conversation)) {
// TRANS: Client exception thrown when referring to a non-existing conversation ID (%d).

View File

@ -64,12 +64,12 @@ class ApiFavoriteCreateAction extends ApiAuthAction
parent::prepare($args);
$this->user = $this->auth_user;
$this->notice = Notice::staticGet($this->arg('id'));
$this->notice = Notice::getKV($this->arg('id'));
if ($this->notice->repeat_of != '' ) {
common_log(LOG_DEBUG, 'Trying to Fave '.$this->notice->id.', repeat of '.$this->notice->repeat_of);
common_log(LOG_DEBUG, 'Will Fave '.$this->notice->repeat_of.' instead');
$real_notice_id = $this->notice->repeat_of;
$this->notice = Notice::staticGet($real_notice_id);
$this->notice = Notice::getKV($real_notice_id);
}
return true;
@ -163,7 +163,7 @@ class ApiFavoriteCreateAction extends ApiAuthAction
*/
function notify($fave, $notice, $user)
{
$other = User::staticGet('id', $notice->profile_id);
$other = User::getKV('id', $notice->profile_id);
if ($other && $other->id != $user->id) {
if ($other->email && $other->emailnotifyfav) {
mail_notify_fave($other, $user, $notice);

View File

@ -64,12 +64,12 @@ class ApiFavoriteDestroyAction extends ApiAuthAction
parent::prepare($args);
$this->user = $this->auth_user;
$this->notice = Notice::staticGet($this->arg('id'));
$this->notice = Notice::getKV($this->arg('id'));
if ($this->notice->repeat_of != '' ) {
common_log(LOG_DEBUG, 'Trying to unFave '.$this->notice->id);
common_log(LOG_DEBUG, 'Will unFave '.$this->notice->repeat_of.' instead');
$real_notice_id = $this->notice->repeat_of;
$this->notice = Notice::staticGet($real_notice_id);
$this->notice = Notice::getKV($real_notice_id);
}
return true;

View File

@ -68,17 +68,17 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction
$target_screen_name = $this->trimmed('target_screen_name');
if (!empty($source_id)) {
$this->source = User::staticGet($source_id);
$this->source = User::getKV($source_id);
} elseif (!empty($source_screen_name)) {
$this->source = User::staticGet('nickname', $source_screen_name);
$this->source = User::getKV('nickname', $source_screen_name);
} else {
$this->source = $this->auth_user;
}
if (!empty($target_id)) {
$this->target = User::staticGet($target_id);
$this->target = User::getKV($target_id);
} elseif (!empty($target_screen_name)) {
$this->target = User::staticGet('nickname', $target_screen_name);
$this->target = User::getKV('nickname', $target_screen_name);
}
return true;

View File

@ -297,13 +297,13 @@ class ApiGroupCreateAction extends ApiAuthAction
*/
function groupNicknameExists($nickname)
{
$local = Local_group::staticGet('nickname', $nickname);
$local = Local_group::getKV('nickname', $nickname);
if (!empty($local)) {
return true;
}
$alias = Group_alias::staticGet('alias', $nickname);
$alias = Group_alias::getKV('alias', $nickname);
if (!empty($alias)) {
return true;

View File

@ -198,7 +198,7 @@ class ApiGroupProfileUpdateAction extends ApiAuthAction
if (!empty($this->nickname) && ($this->nickname != $orig->nickname)) {
common_log(LOG_INFO, "Saving local group info.");
$local = Local_group::staticGet('group_id', $this->group->id);
$local = Local_group::getKV('group_id', $this->group->id);
$local->setNickname($this->nickname);
}
@ -220,14 +220,14 @@ class ApiGroupProfileUpdateAction extends ApiAuthAction
function nicknameExists($nickname)
{
$group = Local_group::staticGet('nickname', $nickname);
$group = Local_group::getKV('nickname', $nickname);
if (!empty($group) &&
$group->group_id != $this->group->id) {
return true;
}
$alias = Group_alias::staticGet('alias', $nickname);
$alias = Group_alias::getKV('alias', $nickname);
if (!empty($alias) &&
$alias->group_id != $this->group->id) {

View File

@ -68,7 +68,7 @@ class ApiGroupShowAction extends ApiPrivateAuthAction
$this->group = $this->getTargetGroup($this->arg('id'));
if (empty($this->group)) {
$alias = Group_alias::staticGet(
$alias = Group_alias::getKV(
'alias',
common_canonical_nickname($this->arg('id'))
);

View File

@ -126,7 +126,7 @@ class ApiSearchJSONAction extends ApiPrivateAuthAction
$stream = new TagNoticeStream(substr($q, 1), $this->auth_profile);
} else if ($this->isAnURL($q)) {
$canon = File_redirection::_canonUrl($q);
$file = File::staticGet('url', $canon);
$file = File::getKV('url', $canon);
if (!empty($file)) {
$stream = new FileNoticeStream($file, $this->auth_profile);
}

View File

@ -77,7 +77,7 @@ class ApiStatusesDestroyAction extends ApiAuthAction
$this->notice_id = (int)$this->arg('id');
}
$this->notice = Notice::staticGet((int)$this->notice_id);
$this->notice = Notice::getKV((int)$this->notice_id);
return true;
}

View File

@ -67,7 +67,7 @@ class ApiStatusesRetweetAction extends ApiAuthAction
$id = $this->trimmed('id');
$this->original = Notice::staticGet('id', $id);
$this->original = Notice::getKV('id', $id);
if (empty($this->original)) {
// TRANS: Client error displayed trying to repeat a non-existing notice through the API.

View File

@ -63,7 +63,7 @@ class ApiStatusesRetweetsAction extends ApiAuthAction
$id = $this->trimmed('id');
$this->original = Notice::staticGet('id', $id);
$this->original = Notice::getKV('id', $id);
if (empty($this->original)) {
// TRANS: Client error displayed trying to display redents of a non-exiting notice.

View File

@ -82,7 +82,7 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction
$this->notice_id = (int)$this->arg('id');
}
$this->notice = Notice::staticGet((int)$this->notice_id);
$this->notice = Notice::getKV((int)$this->notice_id);
return true;
}
@ -147,7 +147,7 @@ class ApiStatusesShowAction extends ApiPrivateAuthAction
// XXX: Twitter just sets a 404 header and doens't bother
// to return an err msg
$deleted = Deleted_notice::staticGet($this->notice_id);
$deleted = Deleted_notice::getKV($this->notice_id);
if (!empty($deleted)) {
$this->clientError(

View File

@ -254,7 +254,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
if (!empty($this->in_reply_to_status_id)) {
// Check whether notice actually exists
$reply = Notice::staticGet($this->in_reply_to_status_id);
$reply = Notice::getKV($this->in_reply_to_status_id);
if ($reply) {
$reply_to = $this->in_reply_to_status_id;

View File

@ -414,7 +414,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
common_debug("Note ID is {$note->id}");
if (!empty($note->id)) {
$notice = Notice::staticGet('uri', trim($note->id));
$notice = Notice::getKV('uri', trim($note->id));
if (!empty($notice)) {
// TRANS: Client error displayed when using another format than AtomPub.
@ -445,7 +445,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
if (!empty($profile)) {
$options['replies'][] = $uri;
} else {
$group = User_group::staticGet('uri', $uri);
$group = User_group::getKV('uri', $uri);
if (!empty($group)) {
$options['groups'][] = $group->id;
} else {
@ -459,7 +459,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
// @fixme what about conversation ID?
if (!empty($activity->context->replyToID)) {
$orig = Notice::staticGet('uri',
$orig = Notice::getKV('uri',
$activity->context->replyToID);
if (!empty($orig)) {
$options['reply_to'] = $orig->id;

View File

@ -56,7 +56,7 @@ class ApiUserProfileImageAction extends ApiPrivateAuthAction
function prepare($args)
{
parent::prepare($args);
$this->user = User::staticGet('nickname', $this->arg('screen_name'));
$this->user = User::getKV('nickname', $this->arg('screen_name'));
$this->size = $this->arg('size');
return true;

View File

@ -68,7 +68,7 @@ class ApiUserShowAction extends ApiPrivateAuthAction
// XXX: email field deprecated in Twitter's API
if (!empty($email)) {
$this->user = User::staticGet('email', $email);
$this->user = User::getKV('email', $email);
} else {
$this->user = $this->getTargetUser($this->arg('id'));
}

View File

@ -63,7 +63,7 @@ class ApprovegroupAction extends Action
$nickname_arg = $this->trimmed('nickname');
$id = intval($this->arg('id'));
if ($id) {
$this->group = User_group::staticGet('id', $id);
$this->group = User_group::getKV('id', $id);
} else if ($nickname_arg) {
$nickname = common_canonical_nickname($nickname_arg);
@ -75,7 +75,7 @@ class ApprovegroupAction extends Action
return false;
}
$local = Local_group::staticGet('nickname', $nickname);
$local = Local_group::getKV('nickname', $nickname);
if (!$local) {
// TRANS: Client error displayed when trying to leave a non-local group.
@ -83,7 +83,7 @@ class ApprovegroupAction extends Action
return false;
}
$this->group = User_group::staticGet('id', $local->group_id);
$this->group = User_group::getKV('id', $local->group_id);
} else {
// TRANS: Client error displayed when trying to leave a group without providing a group name or group ID.
$this->clientError(_('No nickname or ID.'), 404);
@ -104,7 +104,7 @@ class ApprovegroupAction extends Action
}
if ($this->arg('profile_id')) {
if ($cur->isAdmin($this->group)) {
$this->profile = Profile::staticGet('id', $this->arg('profile_id'));
$this->profile = Profile::getKV('id', $this->arg('profile_id'));
} else {
// TRANS: Client error displayed trying to approve group membership while not a group administrator.
$this->clientError(_('Only group admin can approve or cancel join requests.'), 403);

View File

@ -61,7 +61,7 @@ class ApprovesubAction extends Action
return false;
}
if ($this->arg('profile_id')) {
$this->profile = Profile::staticGet('id', $this->arg('profile_id'));
$this->profile = Profile::getKV('id', $this->arg('profile_id'));
} else {
// TRANS: Client error displayed trying to approve subscriptionswithout specifying a profile to approve.
$this->clientError(_('Must specify a profile.'));

View File

@ -62,7 +62,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction
{
parent::prepare($argarray);
$this->_profile = Profile::staticGet('id', $this->trimmed('profile'));
$this->_profile = Profile::getKV('id', $this->trimmed('profile'));
if (empty($this->_profile)) {
// TRANS: Client exception thrown when requesting a favorite feed for a non-existing profile.
@ -251,7 +251,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction
return;
}
$notice = Notice::staticGet('uri', $note->id);
$notice = Notice::getKV('uri', $note->id);
if (empty($notice)) {
// XXX: import from listed URL or something
@ -362,7 +362,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction
*/
function notify($fave, $notice, $user)
{
$other = User::staticGet('id', $notice->profile_id);
$other = User::getKV('id', $notice->profile_id);
if ($other && $other->id != $user->id) {
if ($other->email && $other->emailnotifyfav) {
mail_notify_fave($other, $user, $notice);

View File

@ -64,7 +64,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction
$profileId = $this->trimmed('profile');
$this->_profile = Profile::staticGet('id', $profileId);
$this->_profile = Profile::getKV('id', $profileId);
if (empty($this->_profile)) {
// TRANS: Client exception.
@ -250,7 +250,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction
return;
}
$group = User_group::staticGet('uri', $groupObj->id);
$group = User_group::getKV('uri', $groupObj->id);
if (empty($group)) {
// XXX: import from listed URL or something

View File

@ -68,14 +68,14 @@ class AtompubshowfavoriteAction extends ApiAuthAction
$profileId = $this->trimmed('profile');
$noticeId = $this->trimmed('notice');
$this->_profile = Profile::staticGet('id', $profileId);
$this->_profile = Profile::getKV('id', $profileId);
if (empty($this->_profile)) {
// TRANS: Client exception.
throw new ClientException(_('No such profile.'), 404);
}
$this->_notice = Notice::staticGet('id', $noticeId);
$this->_notice = Notice::getKV('id', $noticeId);
if (empty($this->_notice)) {
// TRANS: Client exception thrown when referencing a non-existing notice.

View File

@ -65,7 +65,7 @@ class AtompubshowmembershipAction extends ApiAuthAction
$profileId = $this->trimmed('profile');
$this->_profile = Profile::staticGet('id', $profileId);
$this->_profile = Profile::getKV('id', $profileId);
if (empty($this->_profile)) {
// TRANS: Client exception.
@ -74,7 +74,7 @@ class AtompubshowmembershipAction extends ApiAuthAction
$groupId = $this->trimmed('group');
$this->_group = User_group::staticGet('id', $groupId);
$this->_group = User_group::getKV('id', $groupId);
if (empty($this->_group)) {
// TRANS: Client exception thrown when referencing a non-existing group.

View File

@ -64,7 +64,7 @@ class AtompubshowsubscriptionAction extends ApiAuthAction
parent::prepare($argarray);
$subscriberId = $this->trimmed('subscriber');
$this->_subscriber = Profile::staticGet('id', $subscriberId);
$this->_subscriber = Profile::getKV('id', $subscriberId);
if (empty($this->_subscriber)) {
// TRANS: Client exception thrown when trying to display a subscription for a non-existing profile ID.
@ -75,7 +75,7 @@ class AtompubshowsubscriptionAction extends ApiAuthAction
$subscribedId = $this->trimmed('subscribed');
$this->_subscribed = Profile::staticGet('id', $subscribedId);
$this->_subscribed = Profile::getKV('id', $subscribedId);
if (empty($this->_subscribed)) {
// TRANS: Client exception thrown when trying to display a subscription for a non-existing profile ID.

View File

@ -66,7 +66,7 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
$subscriber = $this->trimmed('subscriber');
$this->_profile = Profile::staticGet('id', $subscriber);
$this->_profile = Profile::getKV('id', $subscriber);
if (empty($this->_profile)) {
// TRANS: Client exception thrown when trying to display a subscription for a non-existing profile ID.

View File

@ -65,7 +65,7 @@ class AttachmentAction extends Action
parent::prepare($args);
if ($id = $this->trimmed('attachment')) {
$this->attachment = File::staticGet($id);
$this->attachment = File::getKV($id);
}
if (empty($this->attachment)) {

View File

@ -71,7 +71,7 @@ class Attachment_thumbnailAction extends AttachmentAction
*/
function showCore()
{
$file_thumbnail = File_thumbnail::staticGet('file_id', $this->attachment->id);
$file_thumbnail = File_thumbnail::getKV('file_id', $this->attachment->id);
if (empty($file_thumbnail->url)) {
return;
}

View File

@ -73,7 +73,7 @@ class AvatarbynicknameAction extends Action
return;
}
$user = User::staticGet('nickname', $nickname);
$user = User::getKV('nickname', $nickname);
if (!$user) {
// TRANS: Client error displayed trying to get an avatar for a non-existing user.
$this->clientError(_('No such user.'));

View File

@ -74,7 +74,7 @@ class BlockedfromgroupAction extends GroupAction
return false;
}
$local = Local_group::staticGet('nickname', $nickname);
$local = Local_group::getKV('nickname', $nickname);
if (!$local) {
// TRANS: Client error displayed when requesting a list of blocked users for a non-local group.
@ -82,7 +82,7 @@ class BlockedfromgroupAction extends GroupAction
return false;
}
$this->group = User_group::staticGet('id', $local->group_id);
$this->group = User_group::getKV('id', $local->group_id);
if (!$this->group) {
// TRANS: Client error displayed when requesting a list of blocked users for a non-existing group.

View File

@ -63,7 +63,7 @@ class CancelgroupAction extends Action
$nickname_arg = $this->trimmed('nickname');
$id = intval($this->arg('id'));
if ($id) {
$this->group = User_group::staticGet('id', $id);
$this->group = User_group::getKV('id', $id);
} else if ($nickname_arg) {
$nickname = common_canonical_nickname($nickname_arg);
@ -74,7 +74,7 @@ class CancelgroupAction extends Action
return false;
}
$local = Local_group::staticGet('nickname', $nickname);
$local = Local_group::getKV('nickname', $nickname);
if (!$local) {
// TRANS: Client error displayed when trying to leave a non-local group.
@ -82,7 +82,7 @@ class CancelgroupAction extends Action
return false;
}
$this->group = User_group::staticGet('id', $local->group_id);
$this->group = User_group::getKV('id', $local->group_id);
} else {
// TRANS: Client error displayed when trying to leave a group without providing a group name or group ID.
$this->clientError(_('No nickname or ID.'), 404);
@ -103,7 +103,7 @@ class CancelgroupAction extends Action
}
if ($this->arg('profile_id')) {
if ($cur->isAdmin($this->group)) {
$this->profile = Profile::staticGet('id', $this->arg('profile_id'));
$this->profile = Profile::getKV('id', $this->arg('profile_id'));
} else {
// TRANS: Client error displayed when trying to approve or cancel a group join request without
// TRANS: being a group administrator.

View File

@ -85,7 +85,7 @@ class CancelsubscriptionAction extends Action
return;
}
$other = Profile::staticGet('id', $other_id);
$other = Profile::getKV('id', $other_id);
if (!$other) {
// TRANS: Client error displayed when trying to leave a non-existing group.

View File

@ -74,7 +74,7 @@ class ConfirmaddressAction extends Action
$this->clientError(_('No confirmation code.'));
return;
}
$confirm = Confirm_address::staticGet('code', $code);
$confirm = Confirm_address::getKV('code', $code);
if (!$confirm) {
// TRANS: Client error displayed when providing a non-existing confirmation code in the contact address confirmation action.
$this->clientError(_('Confirmation code not found.'));
@ -110,7 +110,7 @@ class ConfirmaddressAction extends Action
if ($type == 'sms') {
$cur->carrier = ($confirm->address_extra)+0;
$carrier = Sms_carrier::staticGet($cur->carrier);
$carrier = Sms_carrier::getKV($cur->carrier);
$cur->smsemail = $carrier->toEmailAddress($cur->sms);
}

View File

@ -64,7 +64,7 @@ class DeleteapplicationAction extends Action
}
$id = (int)$this->arg('id');
$this->app = Oauth_application::staticGet('id', $id);
$this->app = Oauth_application::getKV('id', $id);
if (empty($this->app)) {
// TRANS: Client error displayed trying to delete an application that does not exist.

View File

@ -68,7 +68,7 @@ class DeletegroupAction extends RedirectingAction
$nickname_arg = $this->trimmed('nickname');
$id = intval($this->arg('id'));
if ($id) {
$this->group = User_group::staticGet('id', $id);
$this->group = User_group::getKV('id', $id);
} else if ($nickname_arg) {
$nickname = common_canonical_nickname($nickname_arg);
@ -80,7 +80,7 @@ class DeletegroupAction extends RedirectingAction
return false;
}
$local = Local_group::staticGet('nickname', $nickname);
$local = Local_group::getKV('nickname', $nickname);
if (!$local) {
// TRANS: Client error when trying to delete a non-local group.
@ -88,7 +88,7 @@ class DeletegroupAction extends RedirectingAction
return false;
}
$this->group = User_group::staticGet('id', $local->group_id);
$this->group = User_group::getKV('id', $local->group_id);
} else {
// TRANS: Client error when trying to delete a group without providing a nickname or ID for the group.
$this->clientError(_('No nickname or ID.'), 404);

View File

@ -54,7 +54,7 @@ class DeletenoticeAction extends Action
}
$notice_id = $this->trimmed('notice');
$this->notice = Notice::staticGet($notice_id);
$this->notice = Notice::getKV($notice_id);
if (!$this->notice) {
// TRANS: Error message displayed trying to delete a non-existing notice.

View File

@ -67,7 +67,7 @@ class DeleteuserAction extends ProfileFormAction
return false;
}
$this->user = User::staticGet('id', $this->profile->id);
$this->user = User::getKV('id', $this->profile->id);
if (empty($this->user)) {
// TRANS: Client error displayed when trying to delete a non-local user.

View File

@ -68,7 +68,7 @@ class DisfavorAction extends Action
return;
}
$id = $this->trimmed('notice');
$notice = Notice::staticGet($id);
$notice = Notice::getKV($id);
$token = $this->trimmed('token-'.$notice->id);
if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.

View File

@ -69,8 +69,8 @@ class EditApplicationAction extends Action
$id = (int)$this->arg('id');
$this->app = Oauth_application::staticGet($id);
$this->owner = User::staticGet($this->app->owner);
$this->app = Oauth_application::getKV($id);
$this->owner = User::getKV($this->app->owner);
$cur = common_current_user();
if ($cur->id != $this->owner->id) {
@ -302,7 +302,7 @@ class EditApplicationAction extends Action
*/
function nameExists($name)
{
$newapp = Oauth_application::staticGet('name', $name);
$newapp = Oauth_application::getKV('name', $name);
if (empty($newapp)) {
return false;
} else {

View File

@ -89,11 +89,11 @@ class EditgroupAction extends GroupAction
$groupid = $this->trimmed('groupid');
if ($groupid) {
$this->group = User_group::staticGet('id', $groupid);
$this->group = User_group::getKV('id', $groupid);
} else {
$local = Local_group::staticGet('nickname', $nickname);
$local = Local_group::getKV('nickname', $nickname);
if ($local) {
$this->group = User_group::staticGet('id', $local->group_id);
$this->group = User_group::getKV('id', $local->group_id);
}
}
@ -288,7 +288,7 @@ class EditgroupAction extends GroupAction
if ($nickname != $orig->nickname) {
common_log(LOG_INFO, "Saving local group info.");
$local = Local_group::staticGet('group_id', $this->group->id);
$local = Local_group::getKV('group_id', $this->group->id);
$local->setNickname($nickname);
}
@ -309,14 +309,14 @@ class EditgroupAction extends GroupAction
function nicknameExists($nickname)
{
$group = Local_group::staticGet('nickname', $nickname);
$group = Local_group::getKV('nickname', $nickname);
if (!empty($group) &&
$group->group_id != $this->group->id) {
return true;
}
$alias = Group_alias::staticGet('alias', $nickname);
$alias = Group_alias::getKV('alias', $nickname);
if (!empty($alias) &&
$alias->group_id != $this->group->id) {

View File

@ -93,9 +93,9 @@ class EditpeopletagAction extends Action
$user = null;
if ($id) {
$this->peopletag = Profile_list::staticGet('id', $id);
$this->peopletag = Profile_list::getKV('id', $id);
if (!empty($this->peopletag)) {
$user = User::staticGet('id', $this->peopletag->tagger);
$user = User::getKV('id', $this->peopletag->tagger);
}
} else {
if (!$tagger) {
@ -104,7 +104,7 @@ class EditpeopletagAction extends Action
return false;
}
$user = User::staticGet('nickname', $tagger);
$user = User::getKV('nickname', $tagger);
$this->peopletag = Profile_list::pkeyGet(array('tagger' => $user->id, 'tag' => $tag));
}

View File

@ -578,7 +578,7 @@ class EmailsettingsAction extends SettingsAction
{
$user = common_current_user();
$other = User::staticGet('email', $email);
$other = User::getKV('email', $email);
if (!$other) {
return false;

View File

@ -69,7 +69,7 @@ class FavorAction extends Action
return;
}
$id = $this->trimmed('notice');
$notice = Notice::staticGet($id);
$notice = Notice::getKV($id);
$token = $this->trimmed('token-'.$notice->id);
if (!$token || $token != common_session_token()) {
// TRANS: Client error displayed when the session token does not match or is not given.
@ -117,7 +117,7 @@ class FavorAction extends Action
*/
function notify($notice, $user)
{
$other = User::staticGet('id', $notice->profile_id);
$other = User::getKV('id', $notice->profile_id);
if ($other && $other->id != $user->id) {
if ($other->email && $other->emailnotifyfav) {
mail_notify_fave($other, $user, $notice);

View File

@ -65,7 +65,7 @@ class FavoritesrssAction extends Rss10Action
parent::prepare($args);
$nickname = $this->trimmed('nickname');
$this->user = User::staticGet('nickname', $nickname);
$this->user = User::getKV('nickname', $nickname);
if (!$this->user) {
// TRANS: Client error displayed when trying to get the RSS feed with favorites of a user that does not exist.

View File

@ -35,7 +35,7 @@ class FileAction extends Action
// TRANS: Client error displayed when no notice ID was given trying do display a file.
$this->clientError(_('No notice ID.'));
}
$notice = Notice::staticGet('id', $this->id);
$notice = Notice::getKV('id', $this->id);
if (empty($notice)) {
// TRANS: Client error displayed when an invalid notice ID was given trying do display a file.
$this->clientError(_('No notice.'));

View File

@ -54,7 +54,7 @@ class FoafAction extends Action
return false;
}
$this->user = User::staticGet('nickname', $this->nickname);
$this->user = User::getKV('nickname', $this->nickname);
if (!$this->user) {
// TRANS: Client error displayed when requesting Friends of a Friend feed for an object that is not a user.
@ -170,7 +170,7 @@ class FoafAction extends Action
if ($sub->find()) {
while ($sub->fetch()) {
$profile = Profile::staticGet('id', $sub->subscriber);
$profile = Profile::getKV('id', $sub->subscriber);
if (empty($profile)) {
common_debug('Got a bad subscription: '.print_r($sub,true));
continue;
@ -207,7 +207,7 @@ class FoafAction extends Action
if ($local == 'local') {
$foaf_url = common_local_url('foaf', array('nickname' => $nickname));
}
$profile = Profile::staticGet($id);
$profile = Profile::getKV($id);
$this->elementStart('Agent', array('rdf:about' => $uri));
if ($type == BOTH) {
$this->element('knows', array('rdf:resource' => $this->user->uri));
@ -284,7 +284,7 @@ class FoafAction extends Action
if ($sub->find()) {
while ($sub->fetch()) {
$profile = Profile::staticGet('id', $sub->subscribed);
$profile = Profile::getKV('id', $sub->subscribed);
if (empty($profile)) {
common_debug('Got a bad subscription: '.print_r($sub,true));
continue;

View File

@ -58,7 +58,7 @@ class FoafGroupAction extends Action
return false;
}
$local = Local_group::staticGet('nickname', $this->nickname);
$local = Local_group::getKV('nickname', $this->nickname);
if (!$local) {
// TRANS: Client error displayed when requesting Friends of a Friend feed for a non-local group.
@ -66,7 +66,7 @@ class FoafGroupAction extends Action
return false;
}
$this->group = User_group::staticGet('id', $local->group_id);
$this->group = User_group::getKV('id', $local->group_id);
if (!$this->group) {
// TRANS: Client error displayed when requesting Friends of a Friend feed for a nickname that is not a group.

View File

@ -72,7 +72,7 @@ class GroupblockAction extends RedirectingAction
$this->clientError(_('No profile specified.'));
return false;
}
$this->profile = Profile::staticGet('id', $id);
$this->profile = Profile::getKV('id', $id);
if (empty($this->profile)) {
// TRANS: Client error displayed trying to block a user from a group while specifying a non-existing profile.
$this->clientError(_('No profile with that ID.'));
@ -84,7 +84,7 @@ class GroupblockAction extends RedirectingAction
$this->clientError(_('No group specified.'));
return false;
}
$this->group = User_group::staticGet('id', $group_id);
$this->group = User_group::getKV('id', $group_id);
if (empty($this->group)) {
// TRANS: Client error displayed trying to block a user from a group while specifying a non-existing group.
$this->clientError(_('No such group.'));

View File

@ -76,7 +76,7 @@ class GroupbyidAction extends Action
common_debug("Got ID $id");
$this->group = User_group::staticGet('id', $id);
$this->group = User_group::getKV('id', $id);
if (!$this->group) {
// TRANS: Client error displayed referring to a group's permalink for a non-existing group ID.

View File

@ -90,11 +90,11 @@ class GrouplogoAction extends GroupAction
$groupid = $this->trimmed('groupid');
if ($groupid) {
$this->group = User_group::staticGet('id', $groupid);
$this->group = User_group::getKV('id', $groupid);
} else {
$local = Local_group::staticGet('nickname', $nickname);
$local = Local_group::getKV('nickname', $nickname);
if ($local) {
$this->group = User_group::staticGet('id', $local->group_id);
$this->group = User_group::getKV('id', $local->group_id);
}
}

View File

@ -78,7 +78,7 @@ class GroupqueueAction extends GroupAction
return false;
}
$local = Local_group::staticGet('nickname', $nickname);
$local = Local_group::getKV('nickname', $nickname);
if (!$local) {
// TRANS: Client error displayed when trying to view group members for a non-existing group.
@ -86,7 +86,7 @@ class GroupqueueAction extends GroupAction
return false;
}
$this->group = User_group::staticGet('id', $local->group_id);
$this->group = User_group::getKV('id', $local->group_id);
if (!$this->group) {
// TRANS: Client error displayed when trying to view group members for an object that is not a group.

View File

@ -90,7 +90,7 @@ class groupRssAction extends Rss10Action
return false;
}
$local = Local_group::staticGet('nickname', $nickname);
$local = Local_group::getKV('nickname', $nickname);
if (!$local) {
// TRANS: Client error displayed when requesting a group RSS feed for group that does not exist.
@ -98,7 +98,7 @@ class groupRssAction extends Rss10Action
return false;
}
$this->group = User_group::staticGet('id', $local->group_id);
$this->group = User_group::getKV('id', $local->group_id);
if (!$this->group) {
// TRANS: Client error displayed when requesting a group RSS feed for an object that is not a group.

View File

@ -72,7 +72,7 @@ class GroupunblockAction extends Action
$this->clientError(_('No profile specified.'));
return false;
}
$this->profile = Profile::staticGet('id', $id);
$this->profile = Profile::getKV('id', $id);
if (empty($this->profile)) {
// TRANS: Client error displayed when trying to unblock a user from a group without providing an existing profile.
$this->clientError(_('No profile with that ID.'));
@ -84,7 +84,7 @@ class GroupunblockAction extends Action
$this->clientError(_('No group specified.'));
return false;
}
$this->group = User_group::staticGet('id', $group_id);
$this->group = User_group::getKV('id', $group_id);
if (empty($this->group)) {
// TRANS: Client error displayed when trying to unblock a user from a non-existing group.
$this->clientError(_('No such group.'));

View File

@ -111,7 +111,7 @@ class InviteAction extends Action
foreach ($addresses as $email) {
$email = common_canonical_email($email);
$other = User::staticGet('email', $email);
$other = User::getKV('email', $email);
if ($other) {
if ($user->isSubscribed($other)) {
$this->already[] = $other;

View File

@ -63,7 +63,7 @@ class JoingroupAction extends Action
$nickname_arg = $this->trimmed('nickname');
$id = intval($this->arg('id'));
if ($id) {
$this->group = User_group::staticGet('id', $id);
$this->group = User_group::getKV('id', $id);
} else if ($nickname_arg) {
$nickname = common_canonical_nickname($nickname_arg);
@ -75,7 +75,7 @@ class JoingroupAction extends Action
return false;
}
$local = Local_group::staticGet('nickname', $nickname);
$local = Local_group::getKV('nickname', $nickname);
if (!$local) {
// TRANS: Client error displayed when trying to join a non-local group.
@ -83,7 +83,7 @@ class JoingroupAction extends Action
return false;
}
$this->group = User_group::staticGet('id', $local->group_id);
$this->group = User_group::getKV('id', $local->group_id);
} else {
// TRANS: Client error displayed when trying to join a group without providing a group name or group ID.
$this->clientError(_('No nickname or ID.'), 404);

View File

@ -63,7 +63,7 @@ class LeavegroupAction extends Action
$nickname_arg = $this->trimmed('nickname');
$id = intval($this->arg('id'));
if ($id) {
$this->group = User_group::staticGet('id', $id);
$this->group = User_group::getKV('id', $id);
} else if ($nickname_arg) {
$nickname = common_canonical_nickname($nickname_arg);
@ -75,7 +75,7 @@ class LeavegroupAction extends Action
return false;
}
$local = Local_group::staticGet('nickname', $nickname);
$local = Local_group::getKV('nickname', $nickname);
if (!$local) {
// TRANS: Client error displayed when trying to leave a non-local group.
@ -83,7 +83,7 @@ class LeavegroupAction extends Action
return false;
}
$this->group = User_group::staticGet('id', $local->group_id);
$this->group = User_group::getKV('id', $local->group_id);
} else {
// TRANS: Client error displayed when trying to leave a group without providing a group name or group ID.
$this->clientError(_('No nickname or ID.'), 404);

View File

@ -74,7 +74,7 @@ class MakeadminAction extends RedirectingAction
$this->clientError(_('No profile specified.'));
return false;
}
$this->profile = Profile::staticGet('id', $id);
$this->profile = Profile::getKV('id', $id);
if (empty($this->profile)) {
// TRANS: Client error displayed when specifying an invalid profile ID on the Make Admin page.
$this->clientError(_('No profile with that ID.'));
@ -86,7 +86,7 @@ class MakeadminAction extends RedirectingAction
$this->clientError(_('No group specified.'));
return false;
}
$this->group = User_group::staticGet('id', $group_id);
$this->group = User_group::getKV('id', $group_id);
if (empty($this->group)) {
// TRANS: Client error displayed when providing an invalid group ID on the Make Admin page.
$this->clientError(_('No such group.'));

View File

@ -56,7 +56,7 @@ class MicrosummaryAction extends Action
parent::handle($args);
$nickname = common_canonical_nickname($this->arg('nickname'));
$user = User::staticGet('nickname', $nickname);
$user = User::getKV('nickname', $nickname);
if (!$user) {
// TRANS: Client error displayed trying to make a micro summary without providing a valid user.

View File

@ -317,7 +317,7 @@ class NewApplicationAction extends Action
*/
function nameExists($name)
{
$app = Oauth_application::staticGet('name', $name);
$app = Oauth_application::getKV('name', $name);
return !empty($app);
}
}

View File

@ -239,13 +239,13 @@ class NewgroupAction extends Action
function nicknameExists($nickname)
{
$local = Local_group::staticGet('nickname', $nickname);
$local = Local_group::getKV('nickname', $nickname);
if (!empty($local)) {
return true;
}
$alias = Group_alias::staticGet('alias', $nickname);
$alias = Group_alias::getKV('alias', $nickname);
if (!empty($alias)) {
return true;

View File

@ -112,7 +112,7 @@ class NewmessageAction extends Action
if ($this->to) {
$this->other = User::staticGet('id', $this->to);
$this->other = User::getKV('id', $this->to);
if (!$this->other) {
// TRANS: Client error displayed trying to send a direct message to a non-existing user.

View File

@ -345,7 +345,7 @@ class NewnoticeAction extends Action
if (!$content) {
$replyto = $this->trimmed('replyto');
$inreplyto = $this->trimmed('inreplyto');
$profile = Profile::staticGet('nickname', $replyto);
$profile = Profile::getKV('nickname', $replyto);
if ($profile) {
$content = '@' . $profile->nickname . ' ';
}

View File

@ -66,7 +66,7 @@ class NudgeAction extends Action
}
$user = common_current_user();
$other = User::staticGet('nickname', $this->arg('nickname'));
$other = User::getKV('nickname', $this->arg('nickname'));
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
common_redirect(common_local_url('showstream',

View File

@ -167,7 +167,7 @@ class OauthconnectionssettingsAction extends SettingsAction
return false;
}
$app = Oauth_application::staticGet('id', $appUser->application_id);
$app = Oauth_application::getKV('id', $appUser->application_id);
$datastore = new ApiStatusNetOAuthDataStore();
$datastore->revoke_token($appUser->token, 1);

View File

@ -73,7 +73,7 @@ class OembedAction extends Action
case 'shownotice':
$oembed['type']='link';
$id = $proxy_args['notice'];
$notice = Notice::staticGet($id);
$notice = Notice::getKV($id);
if(empty($notice)){
// TRANS: Server error displayed in oEmbed action when notice not found.
// TRANS: %s is a notice.
@ -96,13 +96,13 @@ class OembedAction extends Action
break;
case 'attachment':
$id = $proxy_args['attachment'];
$attachment = File::staticGet($id);
$attachment = File::getKV($id);
if(empty($attachment)){
// TRANS: Server error displayed in oEmbed action when attachment not found.
// TRANS: %d is an attachment ID.
$this->serverError(sprintf(_('Attachment %s not found.'),$id), 404);
}
if(empty($attachment->filename) && $file_oembed = File_oembed::staticGet('file_id', $attachment->id)){
if(empty($attachment->filename) && $file_oembed = File_oembed::getKV('file_id', $attachment->id)){
// Proxy the existing oembed information
$oembed['type']=$file_oembed->type;
$oembed['provider']=$file_oembed->provider;

View File

@ -98,7 +98,7 @@ class OldschoolsettingsAction extends SettingsAction
{
$user = common_current_user();
$osp = Old_school_prefs::staticGet('user_id', $user->id);
$osp = Old_school_prefs::getKV('user_id', $user->id);
$orig = null;
if (!empty($osp)) {

View File

@ -71,7 +71,7 @@ class OtpAction extends Action
return false;
}
$this->user = User::staticGet('id', $id);
$this->user = User::getKV('id', $id);
if (empty($this->user)) {
// TRANS: Client error displayed trying to use "one time password login" without using an existing user.
@ -87,7 +87,7 @@ class OtpAction extends Action
return false;
}
$this->lt = Login_token::staticGet('user_id', $id);
$this->lt = Login_token::getKV('user_id', $id);
if (empty($this->lt)) {
// TRANS: Client error displayed trying to use "one time password login" without requesting a login token.

View File

@ -85,7 +85,7 @@ class PeopletaggedAction extends Action
return false;
}
$user = User::staticGet('nickname', $tagger);
$user = User::getKV('nickname', $tagger);
if (!$user) {
// TRANS: Client error displayed when referring to non-existing user.

View File

@ -95,7 +95,7 @@ class PeopletagsbyuserAction extends Action
return false;
}
$this->user = User::staticGet('nickname', $nickname);
$this->user = User::getKV('nickname', $nickname);
if (!$this->user) {
// TRANS: Client error displayed trying to perform an action related to a non-existing user.

View File

@ -77,7 +77,7 @@ class PeopletagsforuserAction extends Action
return false;
}
$this->user = User::staticGet('nickname', $nickname);
$this->user = User::getKV('nickname', $nickname);
if (!$this->user) {
// TRANS: Client error displayed trying to perform an action related to a non-existing user.

View File

@ -85,7 +85,7 @@ class PeopletagsubscribersAction extends Action
return false;
}
$user = User::staticGet('nickname', $tagger);
$user = User::getKV('nickname', $tagger);
if (!$user) {
// TRANS: Client error displayed trying to perform an action related to a non-existing user.

View File

@ -79,7 +79,7 @@ class PeopletagsubscriptionsAction extends Action
return false;
}
$user = User::staticGet('nickname', $nickname);
$user = User::getKV('nickname', $nickname);
if (!$user) {
// TRANS: Client error displayed trying to perform an action related to a non-existing user.

View File

@ -94,7 +94,7 @@ class ProfilecompletionAction extends Action
}
$id = $this->arg('peopletag_id');
$this->peopletag = Profile_list::staticGet('id', $id);
$this->peopletag = Profile_list::getKV('id', $id);
if (empty($this->peopletag)) {
// TRANS: Client error displayed trying to reference a non-existing list.

View File

@ -409,7 +409,7 @@ class ProfilesettingsAction extends SettingsAction
$exists = false;
$prefs = User_location_prefs::staticGet('user_id', $user->id);
$prefs = User_location_prefs::getKV('user_id', $user->id);
if (empty($prefs)) {
$prefs = new User_location_prefs();
@ -471,7 +471,7 @@ class ProfilesettingsAction extends SettingsAction
function nicknameExists($nickname)
{
$user = common_current_user();
$other = User::staticGet('nickname', $nickname);
$other = User::getKV('nickname', $nickname);
if (!$other) {
return false;
} else {

View File

@ -60,7 +60,7 @@ class ProfiletagbyidAction extends Action
common_debug("Peopletag id $id by user id $tagger_id");
$this->peopletag = Profile_list::staticGet('id', $id);
$this->peopletag = Profile_list::getKV('id', $id);
if (!$this->peopletag) {
// TRANS: Client error displayed trying to reference a non-existing list.
@ -68,7 +68,7 @@ class ProfiletagbyidAction extends Action
return false;
}
$user = User::staticGet('id', $tagger_id);
$user = User::getKV('id', $tagger_id);
if (!$user) {
// remote peopletag, permanently redirect
common_redirect($this->peopletag->permalink(), 301);

View File

@ -57,7 +57,7 @@ class RecoverpasswordAction extends Action
function checkCode()
{
$code = $this->trimmed('code');
$confirm = Confirm_address::staticGet('code', $code);
$confirm = Confirm_address::getKV('code', $code);
if (!$confirm) {
// TRANS: Client error displayed when password recovery code is not correct.
@ -70,7 +70,7 @@ class RecoverpasswordAction extends Action
return;
}
$user = User::staticGet($confirm->user_id);
$user = User::getKV($confirm->user_id);
if (!$user) {
// TRANS: Server error displayed trying to recover password without providing a user.
@ -137,7 +137,7 @@ class RecoverpasswordAction extends Action
common_ensure_session();
$user_id = $_SESSION['tempuser'];
if ($user_id) {
$user = User::staticGet($user_id);
$user = User::getKV($user_id);
}
return $user;
}

View File

@ -70,7 +70,7 @@ class RedirecturlAction extends Action
throw new ClientException(_('No id parameter.'));
}
$this->file = File::staticGet('id', $this->id);
$this->file = File::getKV('id', $this->id);
if (empty($this->file)) {
// TRANS: Client exception thrown when an invalid ID parameter was provided for a file.

View File

@ -83,7 +83,7 @@ class RegisterAction extends Action
}
if (!empty($this->code)) {
$this->invite = Invitation::staticGet('code', $this->code);
$this->invite = Invitation::getKV('code', $this->code);
if (empty($this->invite)) {
// TRANS: Client error displayed when trying to register to an invite-only site without a valid invitation.
$this->clientError(_('Sorry, invalid invitation code.'));
@ -181,7 +181,7 @@ class RegisterAction extends Action
$code = $this->trimmed('code');
if ($code) {
$invite = Invitation::staticGet($code);
$invite = Invitation::getKV($code);
}
if (common_config('site', 'inviteonly') && !($code && $invite)) {
@ -294,7 +294,7 @@ class RegisterAction extends Action
*/
function nicknameExists($nickname)
{
$user = User::staticGet('nickname', $nickname);
$user = User::getKV('nickname', $nickname);
return is_object($user);
}
@ -313,7 +313,7 @@ class RegisterAction extends Action
if (!$email || strlen($email) == 0) {
return false;
}
$user = User::staticGet('email', $email);
$user = User::getKV('email', $email);
return is_object($user);
}
@ -409,7 +409,7 @@ class RegisterAction extends Action
$invite = null;
if ($code) {
$invite = Invitation::staticGet($code);
$invite = Invitation::getKV($code);
}
if (common_config('site', 'inviteonly') && !($code && $invite)) {

View File

@ -95,7 +95,7 @@ class RemovepeopletagAction extends Action
$tagged_id = $this->arg('tagged');
$this->tagged = Profile::staticGet('id', $tagged_id);
$this->tagged = Profile::getKV('id', $tagged_id);
if (empty($this->tagged)) {
// TRANS: Client error displayed when referring to a non-existing profile.
@ -104,7 +104,7 @@ class RemovepeopletagAction extends Action
}
$id = $this->arg('peopletag_id');
$this->peopletag = Profile_list::staticGet('id', $id);
$this->peopletag = Profile_list::getKV('id', $id);
if (empty($this->peopletag)) {
// TRANS: Client error displayed trying to reference a non-existing list.
@ -132,7 +132,7 @@ class RemovepeopletagAction extends Action
$this->peopletag->tag);
if (!$ptag) {
$user = User::staticGet('id', $this->tagged->id);
$user = User::getKV('id', $this->tagged->id);
if ($user) {
$this->clientError(
// TRANS: Client error displayed when an unknown error occurs while delisting a user.

View File

@ -65,7 +65,7 @@ class RepeatAction extends Action
return false;
}
$this->notice = Notice::staticGet('id', $id);
$this->notice = Notice::getKV('id', $id);
if (empty($this->notice)) {
// TRANS: Client error displayed when trying to repeat a non-existing notice.

View File

@ -65,7 +65,7 @@ class RepliesAction extends Action
$nickname = common_canonical_nickname($this->arg('nickname'));
$this->user = User::staticGet('nickname', $nickname);
$this->user = User::getKV('nickname', $nickname);
if (!$this->user) {
// TRANS: Client error displayed when trying to reply to a non-exsting user.

View File

@ -31,7 +31,7 @@ class RepliesrssAction extends Rss10Action
{
parent::prepare($args);
$nickname = $this->trimmed('nickname');
$this->user = User::staticGet('nickname', $nickname);
$this->user = User::getKV('nickname', $nickname);
if (!$this->user) {
// TRANS: Client error displayed when providing a non-existing nickname in a RSS 1.0 action.

View File

@ -107,7 +107,7 @@ class RsdAction extends Action
return false;
}
$this->user = User::staticGet('nickname', $nickname);
$this->user = User::getKV('nickname', $nickname);
if (empty($this->user)) {
// TRANS: Client error.

View File

@ -71,8 +71,8 @@ class ShowApplicationAction extends Action
$id = (int)$this->arg('id');
$this->application = Oauth_application::staticGet($id);
$this->owner = User::staticGet($this->application->owner);
$this->application = Oauth_application::getKV($id);
$this->owner = User::getKV($this->application->owner);
if (!common_logged_in()) {
// TRANS: Client error displayed trying to display an OAuth application while not logged in.
@ -174,7 +174,7 @@ class ShowApplicationAction extends Action
$this->elementStart('div', 'entity_statistics');
$defaultAccess = ($this->application->access_type & Oauth_application::$writeAccess)
? 'read-write' : 'read-only';
$profile = Profile::staticGet($this->application->owner);
$profile = Profile::getKV($this->application->owner);
$appUsers = new Oauth_application_user();
$appUsers->application_id = $this->application->id;

View File

@ -99,7 +99,7 @@ class ShowfavoritesAction extends Action
$nickname = common_canonical_nickname($this->arg('nickname'));
$this->user = User::staticGet('nickname', $nickname);
$this->user = User::getKV('nickname', $nickname);
if (!$this->user) {
// TRANS: Client error displayed when trying to display favourite notices for a non-existing user.

View File

@ -69,7 +69,7 @@ class ShowmessageAction extends Action
$this->page = 1;
$id = $this->trimmed('message');
$this->message = Message::staticGet('id', $id);
$this->message = Message::getKV('id', $id);
if (!$this->message) {
// TRANS: Client error displayed requesting a single message that does not exist.

View File

@ -100,7 +100,7 @@ class ShownoticeAction extends Action
return false;
}
$this->user = User::staticGet('id', $this->profile->id);
$this->user = User::getKV('id', $this->profile->id);
$this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
@ -117,11 +117,11 @@ class ShownoticeAction extends Action
{
$id = $this->arg('notice');
$notice = Notice::staticGet('id', $id);
$notice = Notice::getKV('id', $id);
if (empty($notice)) {
// Did we used to have it, and it got deleted?
$deleted = Deleted_notice::staticGet($id);
$deleted = Deleted_notice::getKV($id);
if (!empty($deleted)) {
// TRANS: Client error displayed trying to show a deleted notice.
$this->clientError(_('Notice deleted.'), 410);
@ -290,7 +290,7 @@ class ShownoticeAction extends Action
*/
function extraHead()
{
$user = User::staticGet($this->profile->id);
$user = User::getKV($this->profile->id);
if (!$user) {
return;

View File

@ -70,7 +70,7 @@ class ShowprofiletagAction extends Action
return false;
}
$user = User::staticGet('nickname', $tagger);
$user = User::getKV('nickname', $tagger);
if (!$user) {
// TRANS: Client error displayed trying to perform an action related to a non-existing user.

View File

@ -120,7 +120,7 @@ class SmssettingsAction extends SettingsAction
} else {
$confirm = $this->getConfirmation();
if ($confirm) {
$carrier = Sms_carrier::staticGet($confirm->address_extra);
$carrier = Sms_carrier::getKV($confirm->address_extra);
$this->element('p', 'form_unconfirmed',
$confirm->address . ' (' . $carrier->name . ')');
$this->element('p', 'form_guide',
@ -366,7 +366,7 @@ class SmssettingsAction extends SettingsAction
return;
}
$carrier = Sms_carrier::staticGet($carrier_id);
$carrier = Sms_carrier::getKV($carrier_id);
mail_confirm_sms($confirm->code,
$user->nickname,
@ -473,7 +473,7 @@ class SmssettingsAction extends SettingsAction
{
$user = common_current_user();
$other = User::staticGet('sms', $sms);
$other = User::getKV('sms', $sms);
if (!$other) {
return false;

View File

@ -51,7 +51,7 @@ class SubeditAction extends Action
return false;
}
$this->profile = Profile::staticGet('id', $id);
$this->profile = Profile::getKV('id', $id);
if (!$this->profile) {
// TRANS: Client error displayed trying a change a subscription for a non-existant profile ID.

View File

@ -103,7 +103,7 @@ class SubscribeAction extends Action
$other_id = $this->arg('subscribeto');
$this->other = Profile::staticGet('id', $other_id);
$this->other = Profile::getKV('id', $other_id);
if (empty($this->other)) {
// TRANS: Client error displayed trying to subscribe to a non-existing profile.

View File

@ -83,7 +83,7 @@ class SubscribepeopletagAction extends Action
$id = intval($this->arg('id'));
if ($id) {
$this->peopletag = Profile_list::staticGet('id', $id);
$this->peopletag = Profile_list::getKV('id', $id);
} else {
// TRANS: Client error displayed when trying to perform an action without providing an ID.
$this->clientError(_('No ID given.'), 404);
@ -96,7 +96,7 @@ class SubscribepeopletagAction extends Action
return false;
}
$this->tagger = Profile::staticGet('id', $this->peopletag->tagger);
$this->tagger = Profile::getKV('id', $this->peopletag->tagger);
return true;
}

View File

@ -41,7 +41,7 @@ class TagprofileAction extends Action
if (!$id) {
$this->profile = false;
} else {
$this->profile = Profile::staticGet('id', $id);
$this->profile = Profile::getKV('id', $id);
if (!$this->profile) {
// TRANS: Client error displayed when referring to non-existing profile ID.

View File

@ -29,7 +29,7 @@ class TagrssAction extends Rss10Action
function prepare($args) {
parent::prepare($args);
$tag = common_canonical_tag($this->trimmed('tag'));
$this->tag = Notice_tag::staticGet('tag', $tag);
$this->tag = Notice_tag::getKV('tag', $tag);
if (!$this->tag) {
// TRANS: Client error when requesting a tag feed for a non-existing tag.
$this->clientError(_('No such tag.'));

View File

@ -80,7 +80,7 @@ class UnsubscribeAction extends Action
return;
}
$other = Profile::staticGet('id', $other_id);
$other = Profile::getKV('id', $other_id);
if (!$other) {
// TRANS: Client error displayed when trying to unsubscribe while providing a non-existing profile ID.

View File

@ -84,7 +84,7 @@ class UnsubscribepeopletagAction extends Action
$id = intval($this->arg('id'));
if ($id) {
$this->peopletag = Profile_list::staticGet('id', $id);
$this->peopletag = Profile_list::getKV('id', $id);
} else {
// TRANS: Client error displayed when trying to perform an action without providing an ID.
$this->clientError(_('No ID given.'), 404);
@ -97,7 +97,7 @@ class UnsubscribepeopletagAction extends Action
return false;
}
$this->tagger = Profile::staticGet('id', $this->peopletag->tagger);
$this->tagger = Profile::getKV('id', $this->peopletag->tagger);
return true;
}

View File

@ -157,7 +157,7 @@ class UseradminpanelAction extends AdminPanelAction
// Validate default subscription
if (!empty($values['newuser']['default'])) {
$defuser = User::staticGet('nickname', trim($values['newuser']['default']));
$defuser = User::getKV('nickname', trim($values['newuser']['default']));
if (empty($defuser)) {
$this->clientError(
sprintf(

View File

@ -69,7 +69,7 @@ class UserbyidAction extends Action
// TRANS: Client error displayed trying to find a user by ID without providing an ID.
$this->clientError(_('No ID.'));
}
$user = User::staticGet($id);
$user = User::getKV($id);
if (!$user) {
// TRANS: Client error displayed trying to find a user by ID for a non-existing ID.
$this->clientError(_('No such user.'));

View File

@ -88,7 +88,7 @@ class UsergroupsAction extends ProfileAction
return false;
}
$this->user = User::staticGet('nickname', $nickname);
$this->user = User::getKV('nickname', $nickname);
if (!$this->user) {
// TRANS: Client error displayed requesting groups for a non-existing user.

View File

@ -31,7 +31,7 @@ class UserrssAction extends Rss10Action
{
parent::prepare($args);
$nickname = $this->trimmed('nickname');
$this->user = User::staticGet('nickname', $nickname);
$this->user = User::getKV('nickname', $nickname);
$this->tag = $this->trimmed('tag');
if (!$this->user) {

Some files were not shown because too many files have changed in this diff Show More