]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
The overloaded DB_DataObject function staticGet is now called getKV
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 18 Aug 2013 11:04:58 +0000 (13:04 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 18 Aug 2013 11:13:56 +0000 (13:13 +0200)
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.

346 files changed:
actions/addpeopletag.php
actions/allrss.php
actions/apiconversation.php
actions/apifavoritecreate.php
actions/apifavoritedestroy.php
actions/apifriendshipsshow.php
actions/apigroupcreate.php
actions/apigroupprofileupdate.php
actions/apigroupshow.php
actions/apisearchjson.php
actions/apistatusesdestroy.php
actions/apistatusesretweet.php
actions/apistatusesretweets.php
actions/apistatusesshow.php
actions/apistatusesupdate.php
actions/apitimelineuser.php
actions/apiuserprofileimage.php
actions/apiusershow.php
actions/approvegroup.php
actions/approvesub.php
actions/atompubfavoritefeed.php
actions/atompubmembershipfeed.php
actions/atompubshowfavorite.php
actions/atompubshowmembership.php
actions/atompubshowsubscription.php
actions/atompubsubscriptionfeed.php
actions/attachment.php
actions/attachment_thumbnail.php
actions/avatarbynickname.php
actions/blockedfromgroup.php
actions/cancelgroup.php
actions/cancelsubscription.php
actions/confirmaddress.php
actions/deleteapplication.php
actions/deletegroup.php
actions/deletenotice.php
actions/deleteuser.php
actions/disfavor.php
actions/editapplication.php
actions/editgroup.php
actions/editpeopletag.php
actions/emailsettings.php
actions/favor.php
actions/favoritesrss.php
actions/file.php
actions/foaf.php
actions/foafgroup.php
actions/groupblock.php
actions/groupbyid.php
actions/grouplogo.php
actions/groupqueue.php
actions/grouprss.php
actions/groupunblock.php
actions/invite.php
actions/joingroup.php
actions/leavegroup.php
actions/makeadmin.php
actions/microsummary.php
actions/newapplication.php
actions/newgroup.php
actions/newmessage.php
actions/newnotice.php
actions/nudge.php
actions/oauthconnectionssettings.php
actions/oembed.php
actions/oldschoolsettings.php
actions/otp.php
actions/peopletagged.php
actions/peopletagsbyuser.php
actions/peopletagsforuser.php
actions/peopletagsubscribers.php
actions/peopletagsubscriptions.php
actions/profilecompletion.php
actions/profilesettings.php
actions/profiletagbyid.php
actions/recoverpassword.php
actions/redirecturl.php
actions/register.php
actions/removepeopletag.php
actions/repeat.php
actions/replies.php
actions/repliesrss.php
actions/rsd.php
actions/showapplication.php
actions/showfavorites.php
actions/showmessage.php
actions/shownotice.php
actions/showprofiletag.php
actions/smssettings.php
actions/subedit.php
actions/subscribe.php
actions/subscribepeopletag.php
actions/tagprofile.php
actions/tagrss.php
actions/unsubscribe.php
actions/unsubscribepeopletag.php
actions/useradminpanel.php
actions/userbyid.php
actions/usergroups.php
actions/userrss.php
actions/userxrd.php
classes/Fave.php
classes/File.php
classes/File_oembed.php
classes/File_redirection.php
classes/File_to_post.php
classes/Foreign_link.php
classes/Group_join_queue.php
classes/Group_member.php
classes/Login_token.php
classes/Managed_DataObject.php
classes/Memcached_DataObject.php
classes/Message.php
classes/Notice.php
classes/Oauth_application.php
classes/Profile.php
classes/Profile_list.php
classes/Profile_tag.php
classes/Profile_tag_subscription.php
classes/Remote_profile.php
classes/Session.php
classes/Status_network.php
classes/Status_network_tag.php
classes/Subscription.php
classes/Subscription_queue.php
classes/User.php
classes/User_group.php
classes/User_urlshortener_prefs.php
lib/accountprofileblock.php
lib/action.php
lib/activityimporter.php
lib/activitymover.php
lib/activityobject.php
lib/apiaction.php
lib/apiauth.php
lib/applicationlist.php
lib/atomlistnoticefeed.php
lib/attachmentlist.php
lib/authenticationplugin.php
lib/command.php
lib/deluserqueuehandler.php
lib/feedimporter.php
lib/galleryaction.php
lib/groupaction.php
lib/implugin.php
lib/inboxnoticestream.php
lib/jsonsearchresultslist.php
lib/mail.php
lib/mailbox.php
lib/mailhandler.php
lib/mediafile.php
lib/messagelistitem.php
lib/microappplugin.php
lib/noticeform.php
lib/noticelistitem.php
lib/peopletageditform.php
lib/peopletaggroupnav.php
lib/peopletaglist.php
lib/profileaction.php
lib/profileformaction.php
lib/profilenoticestream.php
lib/statusnet.php
lib/statusnetoauthstore.php
lib/stompqueuemanager.php
lib/threadednoticelist.php
lib/toselector.php
lib/util.php
plugins/Activity/ActivityPlugin.php
plugins/Activity/joinlistitem.php
plugins/ActivitySpam/ActivitySpamPlugin.php
plugins/ActivitySpam/Spam_score.php
plugins/ActivitySpam/scripts/silencespammer.php
plugins/ActivitySpam/scripts/testuser.php
plugins/ActivitySpam/scripts/trainuser.php
plugins/ActivitySpam/train.php
plugins/AnonymousFave/AnonymousFavePlugin.php
plugins/AnonymousFave/Fave_tally.php
plugins/AnonymousFave/anondisfavor.php
plugins/AnonymousFave/anonfavor.php
plugins/AuthCrypt/AuthCryptPlugin.php
plugins/AutoSandbox/AutoSandboxPlugin.php
plugins/Blacklist/Homepage_blacklist.php
plugins/Blacklist/Nickname_blacklist.php
plugins/Blog/Blog_entry.php
plugins/Blog/showblogentry.php
plugins/Bookmark/Bookmark.php
plugins/Bookmark/BookmarkPlugin.php
plugins/Bookmark/bookmarkforurl.php
plugins/Bookmark/bookmarklistitem.php
plugins/Bookmark/bookmarks.php
plugins/Bookmark/bookmarksrss.php
plugins/Bookmark/deliciousbookmarkimporter.php
plugins/Bookmark/noticebyurl.php
plugins/Bookmark/showbookmark.php
plugins/Disqus/DisqusPlugin.php
plugins/DomainStatusNetwork/DomainStatusNetworkPlugin.php
plugins/DomainStatusNetwork/lib/domainstatusnetworkinstaller.php
plugins/EmailAuthentication/EmailAuthenticationPlugin.php
plugins/EmailRegistration/EmailRegistrationPlugin.php
plugins/EmailRegistration/emailregister.php
plugins/EmailReminder/EmailReminderPlugin.php
plugins/EmailSummary/EmailSummaryPlugin.php
plugins/EmailSummary/Email_summary_status.php
plugins/EmailSummary/useremailsummaryhandler.php
plugins/Enjit/enjitqueuehandler.php
plugins/Event/EventPlugin.php
plugins/Event/Happening.php
plugins/Event/RSVP.php
plugins/Event/cancelrsvp.php
plugins/Event/newrsvp.php
plugins/Event/showevent.php
plugins/Event/showrsvp.php
plugins/ExtendedProfile/ExtendedProfilePlugin.php
plugins/FacebookBridge/actions/facebookfinishlogin.php
plugins/FacebookBridge/classes/Notice_to_item.php
plugins/FacebookBridge/lib/facebookclient.php
plugins/FollowEveryone/User_followeveryone_prefs.php
plugins/GNUsocialPhoto/Photo.php
plugins/GNUsocialPhotos/GNUsocialPhotosPlugin.php
plugins/GNUsocialPhotos/actions/editphoto.php
plugins/GNUsocialPhotos/actions/photo.php
plugins/GNUsocialPhotos/actions/photos.php
plugins/GNUsocialPhotos/actions/photoupload.php
plugins/GNUsocialPhotos/classes/gnusocialphotoalbum.php
plugins/GNUsocialProfileExtensions/actions/bio.php
plugins/GNUsocialProfileExtensions/actions/profilefields.php
plugins/GNUsocialVideo/Video.php
plugins/GNUsocialVideo/showvideo.php
plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php
plugins/GroupPrivateMessage/Group_message.php
plugins/GroupPrivateMessage/Group_message_profile.php
plugins/GroupPrivateMessage/Group_privacy_settings.php
plugins/GroupPrivateMessage/groupinbox.php
plugins/GroupPrivateMessage/newgroupmessage.php
plugins/GroupPrivateMessage/showgroupmessage.php
plugins/Mapstraction/map.php
plugins/ModLog/ModLogPlugin.php
plugins/ModPlus/ModPlusPlugin.php
plugins/ModPlus/remoteprofileaction.php
plugins/NoticeTitle/NoticeTitlePlugin.php
plugins/NoticeTitle/Notice_title.php
plugins/OMB/OMBPlugin.php
plugins/OMB/actions/finishremotesubscribe.php
plugins/OMB/actions/remotesubscribe.php
plugins/OMB/actions/userauthorization.php
plugins/OMB/actions/xrds.php
plugins/OMB/lib/omb.php
plugins/OMB/lib/omboauthstore.php
plugins/OMB/lib/ombqueuehandler.php
plugins/OStatus/OStatusPlugin.php
plugins/OStatus/actions/groupsalmon.php
plugins/OStatus/actions/ostatusinit.php
plugins/OStatus/actions/peopletagsalmon.php
plugins/OStatus/actions/pushcallback.php
plugins/OStatus/actions/pushhub.php
plugins/OStatus/actions/usersalmon.php
plugins/OStatus/classes/FeedSub.php
plugins/OStatus/classes/HubSub.php
plugins/OStatus/classes/Ostatus_profile.php
plugins/OStatus/lib/hubprepqueuehandler.php
plugins/OStatus/lib/ostatusqueuehandler.php
plugins/OStatus/lib/pushinqueuehandler.php
plugins/OStatus/lib/salmon.php
plugins/OStatus/lib/salmonqueuehandler.php
plugins/OStatus/lib/xrdaction.php
plugins/OStatus/scripts/fixup-shadow.php
plugins/OStatus/scripts/resub-feed.php
plugins/OStatus/scripts/testfeed.php
plugins/OStatus/scripts/update-profile-data.php
plugins/OStatus/scripts/update-profile.php
plugins/OStatus/scripts/updateostatus.php
plugins/OStatus/tests/slap.php
plugins/OfflineBackup/offlinebackupqueuehandler.php
plugins/OpenID/OpenIDPlugin.php
plugins/OpenID/finishopenidlogin.php
plugins/OpenID/openid.php
plugins/OpenID/openidsettings.php
plugins/Poll/Poll.php
plugins/Poll/PollPlugin.php
plugins/Poll/Poll_response.php
plugins/Poll/pollsettings.php
plugins/Poll/respondpoll.php
plugins/Poll/showpoll.php
plugins/QnA/QnAPlugin.php
plugins/QnA/actions/qnaclosequestion.php
plugins/QnA/actions/qnanewanswer.php
plugins/QnA/actions/qnareviseanswer.php
plugins/QnA/actions/qnashowanswer.php
plugins/QnA/actions/qnashowquestion.php
plugins/QnA/actions/qnavote.php
plugins/QnA/classes/QnA_Answer.php
plugins/QnA/classes/QnA_Question.php
plugins/RSSCloud/RSSCloudRequestNotify.php
plugins/RSSCloud/RSSCloudSubscription.php
plugins/Realtime/RealtimePlugin.php
plugins/Realtime/cleanupchannels.php
plugins/Realtime/closechannel.php
plugins/Realtime/keepalivechannel.php
plugins/RegisterThrottle/RegisterThrottlePlugin.php
plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php
plugins/RequireValidatedEmail/confirmfirstemail.php
plugins/RequireValidatedEmail/registerbyemail.php
plugins/Sample/User_greeting_count.php
plugins/Sitemap/Sitemap_notice_count.php
plugins/Sitemap/Sitemap_user_count.php
plugins/SlicedFavorites/favoritedsliceaction.php
plugins/SubMirror/actions/basemirror.php
plugins/SubMirror/actions/editmirror.php
plugins/SubMirror/actions/mirrorsettings.php
plugins/SubMirror/classes/SubMirror.php
plugins/SubMirror/lib/editmirrorform.php
plugins/TwitterBridge/Notice_to_status.php
plugins/TwitterBridge/TwitterBridgePlugin.php
plugins/TwitterBridge/daemons/synctwitterfriends.php
plugins/TwitterBridge/scripts/fakestream.php
plugins/TwitterBridge/scripts/streamtest.php
plugins/TwitterBridge/twitter.php
plugins/TwitterBridge/twitterauthorization.php
plugins/TwitterBridge/twitterimport.php
plugins/UserFlag/adminprofileflag.php
plugins/YammerImport/lib/yammerimporter.php
plugins/YammerImport/lib/yammerrunner.php
scripts/clear_jabber.php
scripts/command.php
scripts/commandline.inc
scripts/createsim.php
scripts/deletegroup.php
scripts/deleteuser.php
scripts/fixup_blocks.php
scripts/fixup_utf8.php
scripts/handlequeued.php
scripts/joingroup.php
scripts/leavegroup.php
scripts/makegroupadmin.php
scripts/registeruser.php
scripts/sendemail.php
scripts/setpassword.php
scripts/strip_geo.php
scripts/uncache_users.php
scripts/updatelocation.php
scripts/updateurls.php
scripts/upgrade.php
scripts/useremail.php
scripts/userrole.php
tests/ActivityGenerationTests.php
tests/UserRightsTest.php

index a661104d5c96b3b763304a22c6c066d1303ddc63..e5e52b83f007d58f0d9e4d2140bc8bc73632cc87 100644 (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.
index 6d82e551e7cd6fa73395dce2281d3933168ad260..90e6f7a86aa01d5d02343d4cc6c8d0e5fb9ae10d 100644 (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.
index 504787b9a2da979a07e2e5d9aba3b2cc1ae5223b..23ddf02c5d60063cd0c81379f83bf20db410c84f 100644 (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).
index 3f639159cc9edcfb70b3d963e7e92597692a0c0e..26e4325e656bfe63f053c05e647c8a81695687ff 100644 (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);
index 59ca5c96df621c6910a930ed475919f01edc7559..af1b4075f645d83b27eb66c14ba0ea4b78995e72 100644 (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;
index 1eaca49f0e9a5449f692c17dc4eec43e0217d1ad..bf7e7daf62100ffd3c2d6b7707e47b1260dea5be 100644 (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;
index 8615bcff7e9767c3ab7f4791cc7a32281ec0621a..295962896d580355d77292220986d926fa766ff7 100644 (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;
index 379e01a428efd09c694b06b62b2c6405b9661317..eb47fa2512f93b1095d20f4b9746d7f5199cb3f2 100644 (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) {
index a7385ffaaf5a32c1683ecbfce43bf350f79ed141..e99777e32c5326113d11a562570c28733769cb13 100644 (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'))
             );
index 612dbdda5c78abcaa5123c16e81bd083016f8908..710ccdcccf94830efa7d8cf205ec230205fe9d02 100644 (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);
             }
index b4a8870faab92e6e5f5597b8e6701315900d0d7f..1f97b1a9de72a8bc00798cfe31189ba98cbb5750 100644 (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;
      }
index 4832da1823d6243d49a1122a144d4ad9607c5af1..feed505fb23c566aad57dbe4af1c41ca6da1caa9 100644 (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.
index 722019683630d7b152074f50b06a14bf46003d82..3a1a43bc63124b2e87c6dee19e13cdeea0ddea8b 100644 (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.
index 13cc88c2c73bcc6c53d67ae3e6b4a78c559bf1ca..9ab3c46e4cadf60f43b44f2ca2db4405b687275b 100644 (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(
index c772f96afcb089ffb0bd913b72b82b4293e2a457..9144f09002001be66f27f2b9108b3596f3151d01 100644 (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;
index 62d0a5e0d5bbbd78319b3f0aa5aee6833be18ab5..19e1a52d15509131f15c6fe1cfe413b17025ca98 100644 (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;
index 2d26e5c4eaaf3eeae52dd7bdb3d499d04cb7bbc1..08af1789c6fab9c9ca9e6120fb001ed35e39860d 100644 (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;
index 11638954db2a54ba9836245000ef5b68a9a0bd2a..0ea0b2e72fd93643eea57eacaadcfb1417ae30d8 100644 (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'));
         }
index d46a4451c4e496e7c1b7c65150334b2798c114cb..c87d743a7bb3bbd10ac946544c13db9d4dcb851b 100644 (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);
index 5fbb2149bd83d08555937c4a849e6422b1ca4dce..89368686a9eac6afb187c05d71d050140903f112 100644 (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.'));
index 634bb224573dfc7b5b9fce71eeddb023f35bde8c..8d5fde815062bf69a342355b36caaed933e708e7 100644 (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);
index 37e4a386a20cfb27e4f4ec6f85f4ced8f55ed3f4..57d7317eefe38bb9714ad7d4f26ef8c248379e17 100644 (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
index 1727e0c3cf9499e7935ba61fbed13db0cda0c88a..d8f371a39cedd4b2a15da12a1753949e75ab08fb 100644 (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.
index 8bf62912f5268eb8fd3891d859d5fb7dd8c12f0b..025e2cb83eea6067a8871b032e5bc8812baa353f 100644 (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.
index aeff0cbf2a5c6bcec305c41535278f7eb0e8e7ce..4dbb2af2e0d553fcd55e5799fb35ccd375f0d08a 100644 (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.
index 26740da835c212b38b177cd61559ead97a279fd1..744a970d602a6dd5c0bc70a8c34f9723d88da8bb 100644 (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.
index f149ca19d987978e4067bf6497431860e0071c74..321525a55f1fb40b2b4c43f51d1c1adfced0e02c 100644 (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)) {
index 38648b8bef4005d25a4706e721abac7944372b9a..a90f8fd5f8aac8c7a3746ecb24deb3b763e8f7be 100644 (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;
         }
index a581d5ae35ab16595e0236b86356ffad7339e9b0..487f66644ef646d1bda337650dcf1ee4183df576 100644 (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.'));
index caf3911d7d6615f9f96376b40d75e1a8ce0d156f..685d6dd06822a7d7ba49b0c95135f9bddf7eff4e 100644 (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.
index 3074e3ffa3141db4fb47f851a0dbc92f76fc6eea..66ae6b3695b1a984fc02067df336e952bbe35479 100644 (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.
index 226fd0822e803dd44affe97ec015a1e3c45c5fe2..2baecbd22686200a2056173475070f623dae5b91 100644 (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.
index ef4cd7cb0d124862f4437a88b9ee8ceb3ce8cb11..4aae0675a2f219edcbdb507be264cf5b8f36d3c7 100644 (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);
             }
 
index 8c3b8e0ba7e8f9caf22de417beb8cdee77f4f9e4..763d58c762992a2efddc493508b71dc773844bd6 100644 (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.
index 637a7cba733bd7219f01391e47fe62fb604fed69..0a0baf887c9af1d73079e765efc8633268abc0b5 100644 (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);
index e3690c51d4a44891829f504c09e664d8c137dbfd..eb84b4f3ae5d877281e4d205bf4ebc5fa42359b9 100644 (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.
index 19b1e20e833ab918843269905c26762da2a99ef4..9f13468dc498643dd72da3da279d206e65fb0717 100644 (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.
index e9fc17c5b730fd75b9faf3baaf918859d39b48ff..aa4f59857d792282fb76b300e5c9ea1e17f22a2a 100644 (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.
index 2ba5f6b313f6ef46c55aaa95e6dc418b5e8b6f22..8c24540c13608346ee165fb7b74e40db08b05e5f 100644 (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 {
index 7439b9d030ebb09086543a9854b10d84fd3648e8..9febab618d7bebc8ed213ecf9ccafaf63555ffcd 100644 (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) {
index 546d9910ba1dd23239f05248e76c4582cef1fd92..72dcc0df723cca9ff664797551ef0be0045ea487 100644 (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));
         }
 
index 9493be80aab06caf4e9f862973cb07a3db742d84..f12aecd57d4436aba3454226129c55b5807435c7 100644 (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;
index 39d7735d0085a4a43cbab0d9bf0ef92f9a0adb6f..777fec57378456bc7bf44b6c414e3d444fe17729 100644 (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);
index 494327674d9051a4c092aee3015a2be899942dcc..8b5ea548bec3e1193fd9e736699921ab152d086c 100644 (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.
index 49ed8af1d6eff55f89ef6ef77dcb33952dd2a5a2..018f03f53a4b30e29896c6095125114c6fe899c1 100644 (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.'));
index fa6efde6e478bbd9a385cb3b12856302d920a6be..de03c337886e10a1f13a5bc89b4194cb622d82e2 100644 (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;
index 9638ea0f34938c4675d9c50faa2560cdf7852d8c..34332c7e2978ee88f805606d640587355ddc1f66 100644 (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.
index a597d47c29dbc67eaa0f6ea6bfcd4c631826e004..2dbb89751451a718162de6caae220940d51fea28 100644 (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.'));
index f18e4540c05ac84b2d6db5a9c5d81e253eb43486..5baaab5e6da08f37a0ab5564a63e9863afa87282 100644 (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.
index 46ce27427496493be82aaa3598df6663356749b6..529cc693019e2e9dc9e68fc7392236b4436b3519 100644 (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);
             }
         }
 
index 4bbf5dcb023ea249dfbfbdd3edacaff192bcd241..1d5a3cd1341c470c5549c021346561f685521584 100644 (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.
index 0f54fc435b8584c70d2a6285b42a66558b64896f..4728f429f4488245a429c9891945528108c7f02e 100644 (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.
index c14ec04adc3dbeec9b0582c8ff66db5946b7c886..6f26108155b647ebaed33f84bcdda85eee0fd578 100644 (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.'));
index 75800aa8585430854c4dd92425cf4d62f32e4b02..6d2605d05457b0769279cf8d728067c0a8f1d4c0 100644 (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;
index fa5968a2c4c0673f6a244f336dcf540b27119556..da61086b68fbd0e27a33cc3721465bdfc9d2c36c 100644 (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);
index b8aaf83d20d737ec54faad176680873ef893f44d..0d635ed0e244248303f4681bcbcdba2dc8b059a7 100644 (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);
index 8ec8a7ce0c777dd900fef77f420d6e7cd7d60463..5cc27032efa18002490c73b8c990bd1c1599ca50 100644 (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.'));
index 6d47e85c68c931e6b647e0c03dab4d47e1747339..14c626ac513bd52b560910706a8a3a191c53c9f2 100644 (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.
index 23525ef32194471f20a6bc3c5ca6d94048cd3871..63fca13f48f268ad0aeeb1ea9ce6f4b15d581b7e 100644 (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);
     }
 }
index 8e02adaba101d789ca44598df29d209b1df8b125..3d5e8c7f0d30dfaaf701c4b68f1e38052ddc33dc 100644 (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;
index fa1922c4a0a5fe3a7e13ba6ee536cee9f6d2a04b..6882da4f180d46b465b4266ab66512201d5879b4 100644 (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.
index 0aafcd41c6f2dc623497d59cbc212d0ee1a04132..938be69b0f89da4d9a3ae9f5114987ecded6e252 100644 (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 . ' ';
             }
index a44915a2d69955a7692547c164d1ecc34d81c5e3..3287711deed07ecff1005dd6883e2cb9c9f1a1a2 100644 (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',
index 80fac0d50953826ce54253592e825dde1060be4d..1ad4a6f60deb8622fa65dc31d0d0b68bb2f96227 100644 (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);
index e293e4d27d0ed802edc6233a50a809dd25450848..3265763990cb6b5b0cb0ea5febc3e35f5efafe1b 100644 (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;
index 74c6c05cda365b95c6d028bc797335691aab19b0..8c4ff9be2784c823b1b9befbae4963ef4eccb168 100644 (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)) {
index c26965bd6abef1d201773643c2cda2a57935e435..f14bba9a2b3649620e7a3313be4a029a7b9e142a 100644 (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.
index 6f9748c234f6c269e15edd60ec95dfc16736d83e..92bfce6405101230b9ff3c06a09bc97b8c2252e1 100644 (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.
index 8ef1a56ee15eed415461796751064702e61a761c..8a5a53eca4f2bb5720b08a322b14df8faa997aec 100644 (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.
index d30f7321c12dca1c6fefe7c6561c0b67af33bc6a..83122e41055ce0b22c7070d3fd35db7937222758 100644 (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.
index 1834a7e4ad79fd94e238d3700ab0bbefa8f67f4a..123b168596c4698185ac8f2ba8c871b78cf3aa53 100644 (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.
index c49784296914899e90dd62e43607939bba2a95a6..f6baed416febce7abb8b95b783546d04b9d218b8 100644 (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.
index 00dbe9d29d0ac6f1052eebf95ac920699af939b1..9f3f2c9accbf968d94d4d10f4c3f91463a74318b 100644 (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.
index 38424ab7afadbc38d7aa0688065740803170cad5..f5884629678a84d1a114da213d431bf531ea03f1 100644 (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 {
index 396e634abae6fa49d8c7e093c76fd1ac4b270439..f20f1bde4fc62cbcbcd6349dbc9e48e4bd0499a1 100644 (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);
index d8f95b24c3e4f189082c9d82771607f043aa22c7..1565ac9bf34e6999c840e0a7d9c1655cdf9fa45c 100644 (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;
     }
index 2aca4fe02b95ebe82adf713d85d76ca05a2d6626..5c559a8b7ea0bca9dadf1c51b8a381a28f8e7d2f 100644 (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.
index 3fe5e20a131479d94d4818ff9e3e7b6692c84a5f..7a64d3ae58337846ad50854a79f337848a96cccb 100644 (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)) {
index d27175f566ab7f3d17f8ca56edfea14d8583931a..360d1c4c61fe5c106cf975d0f5f63d5e26312022 100644 (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.
index 333e1cd02eacac5de47b128b8f7a97dde4e5f146..7433cf4b73d76925e2a0024d082f65527ccb9442 100644 (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.
index 86042557dc11d2cb1afebc12b14ecb55669365f2..4c6fba9ece7206d0cc16c805e41b740a5481baef 100644 (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.
index 86cd173d3c1eab06537db003537e649b6acc56c8..0c71130718ac6205237eef3d72238d4aaee2b34d 100644 (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.
index f99b86e1a4035fb8c9a68393299e8023c32e9f8a..921e7584c90139898e0878ac56b2ac6861108fd4 100644 (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.
index adfd17a06cd5fbfeb9de95d92a1451028fc3ccb8..b15c830ad8022f33cf96ace21a08e6885bb3883f 100644 (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;
index 64fa14bc82b367132a78b0add5647dfd0f555a9d..a1a2dabb3877ef3a23359ee405a1bbc57c979453 100644 (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.
index 1c867af1190ccbff3ff58d88a8cb4da00c91a7b9..24c7db1d50e74a4f0668f8625f09bc2f095fa818 100644 (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.
index 6055184fcdf2ced037e4cf8bde2dee2be15ebad2..d892e51409fd72adad2be93a3b7c9448a40e559d 100644 (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;
index ec1837f835866a8a78d89545c4306caaf91cd9bf..e7152c0046b22d48e6a4209824bf44e69e9e5e7c 100644 (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.
index d151ff45d6a7b61ed8e388df9ea442eb9d9d04eb..a39eb2cf57bab84e63e810707117c18b4911da8e 100644 (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;
index 7439904af0dd72e6fd118b2444661f4bc3752e83..062c4167cd5c0748faf31bd0758986393edf753b 100644 (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.
index ce1d367cf894fe01a009a23dfe62d82423cecb5a..faa833ade3599be6608e37db125825d59feac294 100644 (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.
index dee0384c5d04040004887ab948ec5d1067e7667d..9a85e38ef6c86da62cf72cd60f9769cb0f92ac7a 100644 (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;
     }
index 4305f4bc885f45643b13941d4fb79b1463601a2c..b4312ad4597b1cfbf0ef4a0a7c86ed16e92b2cf0 100644 (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.
index 5f4831d2214e9a500c0d9ea36366670955cd6f48..091e383b3990b8ad4a24f1dd9d8c16856ce9c44a 100644 (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.'));
index ba9ecd8f00e5d46b3409181f89dc5bfcb4201995..8adfff9cf63ffeb450ec955a8742e28c33b9aa62 100644 (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.
index bb53766cc1d6bafcb96ec2d99d028cd573f7b9ad..5e144ab886a0cf975156cf70ebaaab88ea13567e 100644 (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;
     }
index 1eda1c0c82b2c057d5e41b6f0da538a5f8a88461..7c21b91a5ec25ef61d67b5e7325577a682123a44 100644 (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(
index b8ccd0108e0ab393248637a258998ef42dd63c4a..aa96993e6f39786f9728955284b976a0990266b1 100644 (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.'));
index 9d5946b4841b1f401ae4ca89edfea0718093f24b..9ffc8e0ab34eb6182fc6f0ce8cd04a11b2c29687 100644 (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.
index 99330af57f7edf9e3b260f58ba23b8b3f6e640b8..a688cbf371f2f0ceb2b1aa63ea17913a85eefd32 100644 (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) {
index 6fa738a5c98061d264a719d4be855d60c9ae3ab6..98195d1e337b2b140d1331341ad136cd5771aa88 100644 (file)
@@ -43,15 +43,15 @@ class UserxrdAction extends XrdAction
                 // @fixme if domain checking is added, ensure that it will not
                 //        cause problems with sites that have changed domains!
                 $nick = common_canonical_nickname($nick);
-                $this->user = User::staticGet('nickname', $nick);
+                $this->user = User::getKV('nickname', $nick);
             }
         } else {
-            $this->user = User::staticGet('uri', $this->uri);
+            $this->user = User::getKV('uri', $this->uri);
             if (empty($this->user)) {
                 // try and get it by profile url
-                $profile = Profile::staticGet('profileurl', $this->uri);
+                $profile = Profile::getKV('profileurl', $this->uri);
                 if (!empty($profile)) {
-                    $this->user = User::staticGet('id', $profile->id);
+                    $this->user = User::getKV('id', $profile->id);
                 }
             }
         }
index 9a14036cae7fb14dcacff68d72e111bc4028840a..7eb3a89e5a8714bd3dfbba53673285b1f377b7a9 100644 (file)
@@ -80,8 +80,8 @@ class Fave extends Managed_DataObject
 
     function delete()
     {
-        $profile = Profile::staticGet('id', $this->user_id);
-        $notice  = Notice::staticGet('id', $this->notice_id);
+        $profile = Profile::getKV('id', $this->user_id);
+        $notice  = Notice::getKV('id', $this->notice_id);
 
         $result = null;
 
@@ -120,13 +120,13 @@ class Fave extends Managed_DataObject
 
     function asActivity()
     {
-        $notice = Notice::staticGet('id', $this->notice_id);
+        $notice = Notice::getKV('id', $this->notice_id);
 
         if (!$notice) {
             throw new Exception("Fave for non-existent notice: " . $this->notice_id);
         }
 
-        $profile = Profile::staticGet('id', $this->user_id);
+        $profile = Profile::getKV('id', $this->user_id);
 
         if (!$profile) {
             throw new Exception("Fave by non-existent profile: " . $this->user_id);
index 0f65fdb0a6aaa913c3d0a067e411919b845a35c2..995927ba1a5aba423cb3d876564c081a8a6e2904 100644 (file)
@@ -86,7 +86,7 @@ class File extends Managed_DataObject
         // I don't know why we have to keep doing this but I'm adding this last check to avoid
         // uniqueness bugs.
 
-        $x = File::staticGet('url', $given_url);
+        $x = File::getKV('url', $given_url);
         
         if (empty($x)) {
             $x = new File;
@@ -119,7 +119,7 @@ class File extends Managed_DataObject
             && (('text/html' === substr($redir_data['type'], 0, 9) || 'application/xhtml+xml' === substr($redir_data['type'], 0, 21)))
             && ($oembed_data = File_oembed::_getOembed($given_url))) {
 
-            $fo = File_oembed::staticGet('file_id', $this->id);
+            $fo = File_oembed::getKV('file_id', $this->id);
 
             if (empty($fo)) {
                 File_oembed::saveNew($oembed_data, $this->id);
@@ -153,9 +153,9 @@ class File extends Managed_DataObject
         if (empty($given_url)) return -1;   // error, no url to process
         $given_url = File_redirection::_canonUrl($given_url);
         if (empty($given_url)) return -1;   // error, no url to process
-        $file = File::staticGet('url', $given_url);
+        $file = File::getKV('url', $given_url);
         if (empty($file)) {
-            $file_redir = File_redirection::staticGet('url', $given_url);
+            $file_redir = File_redirection::getKV('url', $given_url);
             if (empty($file_redir)) {
                 // @fixme for new URLs this also looks up non-redirect data
                 // such as target content type, size, etc, which we need
@@ -197,7 +197,7 @@ class File extends Managed_DataObject
         }
 
         if (empty($x)) {
-            $x = File::staticGet('id', $file_id);
+            $x = File::getKV('id', $file_id);
             if (empty($x)) {
                 // @todo FIXME: This could possibly be a clearer message :)
                 // TRANS: Server exception thrown when... Robin thinks something is impossible!
@@ -391,7 +391,7 @@ class File extends Managed_DataObject
             if(in_array($mimetype,$notEnclosureMimeTypes)){
                 // Never treat generic HTML links as an enclosure type!
                 // But if we have oEmbed info, we'll consider it golden.
-                $oembed = File_oembed::staticGet('file_id',$this->id);
+                $oembed = File_oembed::getKV('file_id',$this->id);
                 if($oembed && in_array($oembed->type, array('photo', 'video'))){
                     $mimetype = strtolower($oembed->mimetype);
                     $semicolon = strpos($mimetype,';');
@@ -433,7 +433,7 @@ class File extends Managed_DataObject
      */
     function getThumbnail()
     {
-        return File_thumbnail::staticGet('file_id', $this->id);
+        return File_thumbnail::getKV('file_id', $this->id);
     }
 
     /**
index 7ef1b7cde6aa3a169298ee9563341fdc74990886..551d12cafb0c33f3240a81b3e849da42664f302a 100644 (file)
@@ -113,9 +113,9 @@ class File_oembed extends Managed_DataObject
             $file_oembed->url = $data->url;
             $given_url = File_redirection::_canonUrl($file_oembed->url);
             if (! empty($given_url)){
-                $file = File::staticGet('url', $given_url);
+                $file = File::getKV('url', $given_url);
                 if (empty($file)) {
-                    $file_redir = File_redirection::staticGet('url', $given_url);
+                    $file_redir = File_redirection::getKV('url', $given_url);
                     if (empty($file_redir)) {
                         $redir_data = File_redirection::where($given_url);
                         $file_oembed->mimetype = $redir_data['type'];
@@ -129,7 +129,7 @@ class File_oembed extends Managed_DataObject
         }
         $file_oembed->insert();
         if (!empty($data->thumbnail_url) || ($data->type == 'photo')) {
-            $ft = File_thumbnail::staticGet('file_id', $file_id);
+            $ft = File_thumbnail::getKV('file_id', $file_id);
             if (!empty($ft)) {
                 common_log(LOG_WARNING, "Strangely, a File_thumbnail object exists for new file $file_id",
                            __FILE__);
index 321a0b751f64e41c557ca6537116af3985f38836..00a5216505a8171df20642e0c3c6b0b86fcb956f 100644 (file)
@@ -165,16 +165,16 @@ class File_redirection extends Managed_DataObject
      */
     public function where($in_url, $discover=true) {
         // let's see if we know this...
-        $a = File::staticGet('url', $in_url);
+        $a = File::getKV('url', $in_url);
 
         if (!empty($a)) {
             // this is a direct link to $a->url
             return $a->url;
         } else {
-            $b = File_redirection::staticGet('url', $in_url);
+            $b = File_redirection::getKV('url', $in_url);
             if (!empty($b)) {
                 // this is a redirect to $b->file_id
-                $a = File::staticGet('id', $b->file_id);
+                $a = File::getKV('id', $b->file_id);
                 return $a->url;
             }
         }
@@ -250,7 +250,7 @@ class File_redirection extends Managed_DataObject
         if (!empty($short_url) && $short_url != $long_url) {
             $short_url = (string)$short_url;
             // store it
-            $file = File::staticGet('url', $long_url);
+            $file = File::getKV('url', $long_url);
             if (empty($file)) {
                 // Check if the target URL is itself a redirect...
                 $redir_data = File_redirection::where($long_url);
@@ -264,7 +264,7 @@ class File_redirection extends Managed_DataObject
                     }
                 } else if (is_string($redir_data)) {
                     // The file is a known redirect target.
-                    $file = File::staticGet('url', $redir_data);
+                    $file = File::getKV('url', $redir_data);
                     if (empty($file)) {
                         // @fixme should we save a new one?
                         // this case was triggering sometimes for redirects
@@ -278,7 +278,7 @@ class File_redirection extends Managed_DataObject
             } else {
                 $file_id = $file->id;
             }
-            $file_redir = File_redirection::staticGet('url', $short_url);
+            $file_redir = File_redirection::getKV('url', $short_url);
             if (empty($file_redir)) {
                 $file_redir = new File_redirection;
                 $file_redir->url = $short_url;
index 35d1a0dd545ff5e638463a9968fe65593c4dacad..95ac660f47972b29091184e171f0b6896488d345 100644 (file)
@@ -69,7 +69,7 @@ class File_to_post extends Managed_DataObject
                 $f2p->post_id = $notice_id;
                 $f2p->insert();
                 
-                $f = File::staticGet($file_id);
+                $f = File::getKV($file_id);
 
                 if (!empty($f)) {
                     $f->blowCache();
@@ -91,7 +91,7 @@ class File_to_post extends Managed_DataObject
 
     function delete()
     {
-        $f = File::staticGet('id', $this->file_id);
+        $f = File::getKV('id', $this->file_id);
         if (!empty($f)) {
             $f->blowCache();
         }
index 44ccd63ae4058adecc2a0d8b42ed731e8ee9db1e..39bd5f862a0308ce666c771f361f006e639ec5c1 100644 (file)
@@ -133,7 +133,7 @@ class Foreign_link extends Managed_DataObject
 
     function getUser()
     {
-        return User::staticGet($this->user_id);
+        return User::getKV($this->user_id);
     }
 
     // Make sure we only ever delete one record at a time
index 66137523f15d5ce84c9016f00ea7beb4578bbd93..55467d0dd861a9b0ad153ec275fb771ff972bcdc 100644 (file)
@@ -54,7 +54,7 @@ class Group_join_queue extends Managed_DataObject
 
     function getMember()
     {
-        $member = Profile::staticGet('id', $this->profile_id);
+        $member = Profile::getKV('id', $this->profile_id);
 
         if (empty($member)) {
             // TRANS: Exception thrown providing an invalid profile ID.
@@ -67,7 +67,7 @@ class Group_join_queue extends Managed_DataObject
 
     function getGroup()
     {
-        $group  = User_group::staticGet('id', $this->group_id);
+        $group  = User_group::getKV('id', $this->group_id);
 
         if (empty($group)) {
             // TRANS: Exception thrown providing an invalid group ID.
@@ -123,8 +123,8 @@ class Group_join_queue extends Managed_DataObject
      */
     public function notify()
     {
-        $joiner = Profile::staticGet('id', $this->profile_id);
-        $group = User_group::staticGet('id', $this->group_id);
+        $joiner = Profile::getKV('id', $this->profile_id);
+        $group = User_group::getKV('id', $this->group_id);
         mail_notify_group_join_pending($group, $joiner);
     }
 }
index 390651e9019ab9f78a962c5bc23c6930fa74bf16..1c37abab14bf265baf84dc8c081c21a28837c6a7 100644 (file)
@@ -106,7 +106,7 @@ class Group_member extends Managed_DataObject
 
     function getMember()
     {
-        $member = Profile::staticGet('id', $this->profile_id);
+        $member = Profile::getKV('id', $this->profile_id);
 
         if (empty($member)) {
             // TRANS: Exception thrown providing an invalid profile ID.
@@ -119,7 +119,7 @@ class Group_member extends Managed_DataObject
 
     function getGroup()
     {
-        $group  = User_group::staticGet('id', $this->group_id);
+        $group  = User_group::getKV('id', $this->group_id);
 
         if (empty($group)) {
             // TRANS: Exception thrown providing an invalid group ID.
index 77558c786cacdcad2c9650efb6409087e99ee135..599f21475ac2f133b950b08377ad7533e977ab3c 100644 (file)
@@ -57,7 +57,7 @@ class Login_token extends Managed_DataObject
 
     function makeNew($user)
     {
-        $login_token = Login_token::staticGet('user_id', $user->id);
+        $login_token = Login_token::getKV('user_id', $user->id);
 
         if (!empty($login_token)) {
             $login_token->delete();
index 4886e79724c462789554a78a9ad077bcb6cfe161..cc982cf63c18fda776e3893115eb59bfb5e3cab5 100644 (file)
@@ -39,9 +39,9 @@ abstract class Managed_DataObject extends Memcached_DataObject
      * @return get_called_class() object if found, or null for no hits
      *
      */
-    static function staticGet($k,$v=NULL)
+    static function getKV($k,$v=NULL)
     {
-        return parent::staticGet(get_called_class(),$k,$v);
+        return parent::getKV(get_called_class(),$k,$v);
     }
 
 
index 16ef7e4516baebad170456e04c499b1495b98207..8ff175db0d7b929a1021dc1e1e60861fe3cd0633 100644 (file)
@@ -30,7 +30,7 @@ class Memcached_DataObject extends Safe_DataObject
      * @param mixed $v key field value, or leave out for primary key lookup
      * @return mixed Memcached_DataObject subtype or false
      */
-    static function staticGet($cls, $k, $v=null)
+    static function getKV($cls, $k, $v=null)
     {
         if (is_null($v)) {
             $v = $k;
@@ -350,7 +350,7 @@ class Memcached_DataObject extends Safe_DataObject
     }
 
     /**
-     * @todo FIXME: Should this return false on lookup fail to match staticGet?
+     * @todo FIXME: Should this return false on lookup fail to match getKV?
      */
     function pkeyGet($cls, $kv)
     {
@@ -680,7 +680,7 @@ class Memcached_DataObject extends Safe_DataObject
                         'delete',
                         'update',
                         'find');
-        $ignoreStatic = array('staticGet',
+        $ignoreStatic = array('getKV',
                               'pkeyGet',
                               'cachedQuery');
         $here = get_class($this); // if we get confused
index 3986836836ad4e2e13077d8f4d2ce5329f64af9d..7e8cd6245dd9f019bf39061c57575d6f698743f0 100644 (file)
@@ -59,23 +59,23 @@ class Message extends Managed_DataObject
 
     function getFrom()
     {
-        return Profile::staticGet('id', $this->from_profile);
+        return Profile::getKV('id', $this->from_profile);
     }
 
     function getTo()
     {
-        return Profile::staticGet('id', $this->to_profile);
+        return Profile::getKV('id', $this->to_profile);
     }
 
     static function saveNew($from, $to, $content, $source) {
-        $sender = Profile::staticGet('id', $from);
+        $sender = Profile::getKV('id', $from);
 
         if (!$sender->hasRight(Right::NEWMESSAGE)) {
             // TRANS: Client exception thrown when a user tries to send a direct message while being banned from sending them.
             throw new ClientException(_('You are banned from sending direct messages.'));
         }
 
-        $user = User::staticGet('id', $sender->id);
+        $user = User::getKV('id', $sender->id);
 
         $msg = new Message();
 
@@ -131,8 +131,8 @@ class Message extends Managed_DataObject
 
     function notify()
     {
-        $from = User::staticGet('id', $this->from_profile);
-        $to   = User::staticGet('id', $this->to_profile);
+        $from = User::getKV('id', $this->from_profile);
+        $to   = User::getKV('id', $this->to_profile);
 
         mail_notify_message($this, $from, $to);
     }
@@ -151,11 +151,11 @@ class Message extends Managed_DataObject
                 $ns->code = $this->source;
                 break;
             default:
-                $ns = Notice_source::staticGet($this->source);
+                $ns = Notice_source::getKV($this->source);
                 if (!$ns) {
                     $ns = new Notice_source();
                     $ns->code = $this->source;
-                    $app = Oauth_application::staticGet('name', $this->source);
+                    $app = Oauth_application::getKV('name', $this->source);
                     if ($app) {
                         $ns->name = $app->name;
                         $ns->url  = $app->source_url;
@@ -177,7 +177,7 @@ class Message extends Managed_DataObject
             $act->time    = strtotime($this->created);
             $act->link    = $this->url;
 
-            $profile = Profile::staticGet('id', $this->from_profile);
+            $profile = Profile::getKV('id', $this->from_profile);
 
             if (empty($profile)) {
                 throw new Exception(sprintf("Sender profile not found: %d", $this->from_profile));
@@ -192,7 +192,7 @@ class Message extends Managed_DataObject
 
             $ctx = new ActivityContext();
 
-            $rprofile = Profile::staticGet('id', $this->to_profile);
+            $rprofile = Profile::getKV('id', $this->to_profile);
 
             if (empty($rprofile)) {
                 throw new Exception(sprintf("Receiver profile not found: %d", $this->to_profile));
index 0200601a9d00d983e4951e21157636aa040874c9..743eba12bf9b0f9598f6f97e161bbb7a39f925ea 100644 (file)
@@ -153,7 +153,7 @@ class Notice extends Managed_DataObject
     function getProfile()
     {
         if (is_int($this->_profile) && $this->_profile == -1) {
-            $this->_setProfile(Profile::staticGet('id', $this->profile_id));
+            $this->_setProfile(Profile::getKV('id', $this->profile_id));
 
             if (empty($this->_profile)) {
                 // TRANS: Server exception thrown when a user profile for a notice cannot be found.
@@ -177,10 +177,10 @@ class Notice extends Managed_DataObject
 
         // @fixme we have some cases where things get re-run and so the
         // insert fails.
-        $deleted = Deleted_notice::staticGet('id', $this->id);
+        $deleted = Deleted_notice::getKV('id', $this->id);
 
         if (!$deleted) {
-            $deleted = Deleted_notice::staticGet('uri', $this->uri);
+            $deleted = Deleted_notice::getKV('uri', $this->uri);
         }
 
         if (!$deleted) {
@@ -340,8 +340,8 @@ class Notice extends Managed_DataObject
             $is_local = Notice::LOCAL_PUBLIC;
         }
 
-        $profile = Profile::staticGet('id', $profile_id);
-        $user = User::staticGet('id', $profile_id);
+        $profile = Profile::getKV('id', $profile_id);
+        $user = User::getKV('id', $profile_id);
         if ($user) {
             // Use the local user's shortening preferences, if applicable.
             $final = $user->shortenLinks($content);
@@ -420,7 +420,7 @@ class Notice extends Managed_DataObject
 
             // Check for a private one
 
-            $repeat = Notice::staticGet('id', $repeat_of);
+            $repeat = Notice::getKV('id', $repeat_of);
 
             if (empty($repeat)) {
                 // TRANS: Client exception thrown in notice when trying to repeat a missing or deleted notice.
@@ -540,7 +540,7 @@ class Notice extends Managed_DataObject
         // Force the scope for private groups
 
         foreach ($groups as $groupId) {
-            $group = User_group::staticGet('id', $groupId);
+            $group = User_group::getKV('id', $groupId);
             if (!empty($group)) {
                 if ($group->force_scope) {
                     $notice->scope |= Notice::GROUP_SCOPE;
@@ -647,16 +647,16 @@ class Notice extends Managed_DataObject
             self::blow('notice:list-ids:repeat_of:%d', $this->repeat_of);
         }
 
-        $original = Notice::staticGet('id', $this->repeat_of);
+        $original = Notice::getKV('id', $this->repeat_of);
 
         if (!empty($original)) {
-            $originalUser = User::staticGet('id', $original->profile_id);
+            $originalUser = User::getKV('id', $original->profile_id);
             if (!empty($originalUser)) {
                 $this->blowStream('user:repeats_of_me:%d', $originalUser->id);
             }
         }
 
-        $profile = Profile::staticGet($this->profile_id);
+        $profile = Profile::getKV($this->profile_id);
 
         if (!empty($profile)) {
             $profile->blowNoticeCount();
@@ -723,7 +723,7 @@ class Notice extends Managed_DataObject
         if ($lastStr !== false) {
             $window     = explode(',', $lastStr);
             $lastID     = $window[0];
-            $lastNotice = Notice::staticGet('id', $lastID);
+            $lastNotice = Notice::getKV('id', $lastID);
             if (empty($lastNotice) // just weird
                 || strtotime($lastNotice->created) >= strtotime($this->created)) {
                 $c->delete($lastKey);
@@ -770,7 +770,7 @@ class Notice extends Managed_DataObject
     }
 
     static function checkDupes($profile_id, $content) {
-        $profile = Profile::staticGet($profile_id);
+        $profile = Profile::getKV($profile_id);
         if (empty($profile)) {
             return false;
         }
@@ -798,7 +798,7 @@ class Notice extends Managed_DataObject
     }
 
     static function checkEditThrottle($profile_id) {
-        $profile = Profile::staticGet($profile_id);
+        $profile = Profile::getKV($profile_id);
         if (empty($profile)) {
             return false;
         }
@@ -1018,7 +1018,7 @@ class Notice extends Managed_DataObject
             $originalProfile = null;
             if ($this->repeat_of) {
                 // Check blocks against the original notice's poster as well.
-                $original = Notice::staticGet('id', $this->repeat_of);
+                $original = Notice::getKV('id', $this->repeat_of);
                 if ($original) {
                     $originalProfile = $original->getProfile();
                 }
@@ -1026,7 +1026,7 @@ class Notice extends Managed_DataObject
 
             foreach ($ni as $id => $source) {
                 try {
-                    $user = User::staticGet('id', $id);
+                    $user = User::getKV('id', $id);
                     if (empty($user) ||
                         $user->hasBlocked($profile) ||
                         ($originalProfile && $user->hasBlocked($originalProfile))) {
@@ -1145,7 +1145,7 @@ class Notice extends Managed_DataObject
 
         $groups = array();
         foreach (array_unique($group_ids) as $id) {
-            $group = User_group::staticGet('id', $id);
+            $group = User_group::getKV('id', $id);
             if ($group) {
                 common_log(LOG_ERR, "Local delivery to group id $id, $group->nickname");
                 $result = $this->addToGroupInbox($group);
@@ -1259,7 +1259,7 @@ class Notice extends Managed_DataObject
             return;
         }
 
-        $sender = Profile::staticGet($this->profile_id);
+        $sender = Profile::getKV($this->profile_id);
 
         foreach (array_unique($uris) as $uri) {
 
@@ -1300,7 +1300,7 @@ class Notice extends Managed_DataObject
             return array();
         }
 
-        $sender = Profile::staticGet($this->profile_id);
+        $sender = Profile::getKV($this->profile_id);
 
         $replied = array();
 
@@ -1338,7 +1338,7 @@ class Notice extends Managed_DataObject
 
                 // Don't save replies from blocked profile to local user
 
-                $mentioned_user = User::staticGet('id', $mentioned->id);
+                $mentioned_user = User::getKV('id', $mentioned->id);
                 if (!empty($mentioned_user) && $mentioned_user->hasBlocked($sender)) {
                     continue;
                 }
@@ -1429,7 +1429,7 @@ class Notice extends Managed_DataObject
         $recipientIds = $this->getReplies();
 
         foreach ($recipientIds as $recipientId) {
-            $user = User::staticGet('id', $recipientId);
+            $user = User::getKV('id', $recipientId);
             if (!empty($user)) {
                 mail_notify_attn($user, $this);
             }
@@ -1510,7 +1510,7 @@ class Notice extends Managed_DataObject
             $act->verb = $this->verb;
 
             if ($this->repeat_of) {
-                $repeated = Notice::staticGet('id', $this->repeat_of);
+                $repeated = Notice::getKV('id', $this->repeat_of);
                 if (!empty($repeated)) {
                     $act->objects[] = $repeated->asActivity($cur);
                 }
@@ -1546,7 +1546,7 @@ class Notice extends Managed_DataObject
             $ctx = new ActivityContext();
 
             if (!empty($this->reply_to)) {
-                $reply = Notice::staticGet('id', $this->reply_to);
+                $reply = Notice::getKV('id', $this->reply_to);
                 if (!empty($reply)) {
                     $ctx->replyToID  = $reply->uri;
                     $ctx->replyToUrl = $reply->bestUrl();
@@ -1558,7 +1558,7 @@ class Notice extends Managed_DataObject
             $conv = null;
 
             if (!empty($this->conversation)) {
-                $conv = Conversation::staticGet('id', $this->conversation);
+                $conv = Conversation::getKV('id', $this->conversation);
                 if (!empty($conv)) {
                     $ctx->conversation = $conv->uri;
                 }
@@ -1567,7 +1567,7 @@ class Notice extends Managed_DataObject
             $reply_ids = $this->getReplies();
 
             foreach ($reply_ids as $id) {
-                $rprofile = Profile::staticGet('id', $id);
+                $rprofile = Profile::getKV('id', $id);
                 if (!empty($rprofile)) {
                     $ctx->attention[] = $rprofile->getUri();
                     $ctx->attentionType[$rprofile->getUri()] = ActivityObject::PERSON;
@@ -1598,7 +1598,7 @@ class Notice extends Managed_DataObject
             $repeat = null;
 
             if (!empty($this->repeat_of)) {
-                $repeat = Notice::staticGet('id', $this->repeat_of);
+                $repeat = Notice::getKV('id', $this->repeat_of);
                 if (!empty($repeat)) {
                     $ctx->forwardID  = $repeat->uri;
                     $ctx->forwardUrl = $repeat->bestUrl();
@@ -1640,7 +1640,7 @@ class Notice extends Managed_DataObject
                     $act->source->updated = self::utcDate($notice->created);
                 }
 
-                $user = User::staticGet('id', $profile->id);
+                $user = User::getKV('id', $profile->id);
 
                 if (!empty($user)) {
                     $act->source->links['license'] = common_config('license', 'url');
@@ -1784,7 +1784,7 @@ class Notice extends Managed_DataObject
         // return it if it does
 
         if (!empty($reply_to)) {
-            $reply_notice = Notice::staticGet('id', $reply_to);
+            $reply_notice = Notice::getKV('id', $reply_to);
             if (!empty($reply_notice)) {
                 return $reply_notice;
             }
@@ -1809,7 +1809,7 @@ class Notice extends Managed_DataObject
 
         // Figure out who that is.
 
-        $sender = Profile::staticGet('id', $profile_id);
+        $sender = Profile::getKV('id', $profile_id);
         if (empty($sender)) {
             return null;
         }
@@ -1875,7 +1875,7 @@ class Notice extends Managed_DataObject
      */
     function repeat($repeater_id, $source)
     {
-        $author = Profile::staticGet('id', $this->profile_id);
+        $author = Profile::getKV('id', $this->profile_id);
 
         // TRANS: Message used to repeat a notice. RT is the abbreviation of 'retweet'.
         // TRANS: %1$s is the repeated user's name, %2$s is the repeated notice.
@@ -2109,7 +2109,7 @@ class Notice extends Managed_DataObject
         // have to wait
         Event::handle('StartNoticeDistribute', array($this));
 
-        $user = User::staticGet('id', $this->profile_id);
+        $user = User::getKV('id', $this->profile_id);
         if (!empty($user)) {
             Inbox::insertNotice($user->id, $this->id);
         }
@@ -2180,11 +2180,11 @@ class Notice extends Managed_DataObject
                 $ns->code = $this->source;
                 break;
             default:
-                $ns = Notice_source::staticGet($this->source);
+                $ns = Notice_source::getKV($this->source);
                 if (!$ns) {
                     $ns = new Notice_source();
                     $ns->code = $this->source;
-                    $app = Oauth_application::staticGet('name', $this->source);
+                    $app = Oauth_application::getKV('name', $this->source);
                     if ($app) {
                         $ns->name = $app->name;
                         $ns->url  = $app->source_url;
@@ -2257,12 +2257,12 @@ class Notice extends Managed_DataObject
             return false;
         }
 
-        $notice = Notice::staticGet('id', $id);
+        $notice = Notice::getKV('id', $id);
         if ($notice) {
             return $notice->created;
         }
 
-        $deleted = Deleted_notice::staticGet('id', $id);
+        $deleted = Deleted_notice::getKV('id', $id);
         if ($deleted) {
             return $deleted->created;
         }
@@ -2542,7 +2542,7 @@ class Notice extends Managed_DataObject
             if (empty($this->reply_to)) {
                 $this->_original = null;
             } else {
-                $this->_original = Notice::staticGet('id', $this->reply_to);
+                $this->_original = Notice::getKV('id', $this->reply_to);
             }
         }
         return $this->_original;
index 3bc66f0e2877b7eb973071df775632428011cb6e..90218e93cbd5c6d3019d23dbc214e92c23cfc874 100644 (file)
@@ -37,7 +37,7 @@ class Oauth_application extends Managed_DataObject
 
     function getConsumer()
     {
-        return Consumer::staticGet('consumer_key', $this->consumer_key);
+        return Consumer::getKV('consumer_key', $this->consumer_key);
     }
 
     static function maxDesc()
index 4f631acf40225860147d8cc97d310fb209e00107..bee05981d2b705d3c1c94dd257f9a4cd84058a29 100644 (file)
@@ -92,7 +92,7 @@ class Profile extends Managed_DataObject
     function getUser()
     {
         if (is_int($this->_user) && $this->_user == -1) {
-            $this->_user = User::staticGet('id', $this->id);
+            $this->_user = User::getKV('id', $this->id);
         }
 
         return $this->_user;
@@ -440,7 +440,7 @@ class Profile extends Managed_DataObject
         $lists = array();
 
         foreach ($ids as $id) {
-            $list = Profile_list::staticGet('id', $id);
+            $list = Profile_list::getKV('id', $id);
             if (!empty($list) &&
                 ($showPrivate || !$list->private)) {
 
@@ -637,7 +637,7 @@ class Profile extends Managed_DataObject
         $profiles = array();
 
         while ($subs->fetch()) {
-            $profile = Profile::staticGet($subs->subscribed);
+            $profile = Profile::getKV($subs->subscribed);
             if ($profile) {
                 $profiles[] = $profile;
             }
@@ -655,7 +655,7 @@ class Profile extends Managed_DataObject
         $profiles = array();
 
         while ($subs->fetch()) {
-            $profile = Profile::staticGet($subs->subscriber);
+            $profile = Profile::getKV($subs->subscriber);
             if ($profile) {
                 $profiles[] = $profile;
             }
@@ -958,7 +958,7 @@ class Profile extends Managed_DataObject
         $sub->find();
 
         while ($sub->fetch()) {
-            $other = Profile::staticGet('id', $sub->subscribed);
+            $other = Profile::getKV('id', $sub->subscribed);
             if (empty($other)) {
                 continue;
             }
@@ -973,7 +973,7 @@ class Profile extends Managed_DataObject
         $subd->find();
 
         while ($subd->fetch()) {
-            $other = Profile::staticGet('id', $subd->subscriber);
+            $other = Profile::getKV('id', $subd->subscriber);
             if (empty($other)) {
                 continue;
             }
@@ -1345,7 +1345,7 @@ class Profile extends Managed_DataObject
         if (Event::handle('StartGetProfileUri', array($this, &$uri))) {
 
             // check for a local user first
-            $user = User::staticGet('id', $this->id);
+            $user = User::getKV('id', $this->id);
 
             if (!empty($user)) {
                 $uri = $user->uri;
@@ -1375,7 +1375,7 @@ class Profile extends Managed_DataObject
         $feed = null;
 
         if (Event::handle('StartProfileGetAtomFeed', array($this, &$feed))) {
-            $user = User::staticGet('id', $this->id);
+            $user = User::getKV('id', $this->id);
             if (!empty($user)) {
                 $feed = common_local_url('ApiTimelineUser', array('id' => $user->id,
                                                                   'format' => 'atom'));
@@ -1392,7 +1392,7 @@ class Profile extends Managed_DataObject
 
         if (Event::handle('StartGetProfileFromURI', array($uri, &$profile))) {
             // Get a local user or remote (OMB 0.1) profile
-            $user = User::staticGet('uri', $uri);
+            $user = User::getKV('uri', $uri);
             if (!empty($user)) {
                 $profile = $user->getProfile();
             }
index 9bf66745c261efcee94333ac38f27f3b3b9c2144..749d98d5fcf1018dab84e2a69297128a17e168fb 100644 (file)
@@ -107,7 +107,7 @@ class Profile_list extends Managed_DataObject
 
     function getTagger()
     {
-        return Profile::staticGet('id', $this->tagger);
+        return Profile::getKV('id', $this->tagger);
     }
 
     /**
@@ -683,7 +683,7 @@ class Profile_list extends Managed_DataObject
 
         if (!isset($mainpage) || empty($mainpage)) {
             $orig = clone($ptag);
-            $user = User::staticGet('id', $ptag->tagger);
+            $user = User::getKV('id', $ptag->tagger);
             if(!empty($user)) {
                 $ptag->mainpage = common_local_url('showprofiletag', array('tag' => $ptag->tag, 'tagger' => $user->nickname));
             } else {
index 9970f14fc74c31a73baf95bdda47585d53fb0708..4e0900aa63a2c21a9ee128970ec73aedeb7824da 100644 (file)
@@ -157,8 +157,8 @@ class Profile_tag extends Managed_DataObject
             return $ptag;
         }
 
-        $tagger_profile = Profile::staticGet('id', $tagger);
-        $tagged_profile = Profile::staticGet('id', $tagged);
+        $tagger_profile = Profile::getKV('id', $tagger);
+        $tagged_profile = Profile::getKV('id', $tagged);
 
         if (Event::handle('StartTagProfile', array($tagger_profile, $tagged_profile, $tag))) {
 
index ab2ceed73b85feacb2013025a2da7293eab14a21..28b37940a737a7ed7fba6bd90f3ca1c4ae8025a9 100644 (file)
@@ -73,7 +73,7 @@ class Profile_tag_subscription extends Managed_DataObject
                 throw new Exception(_('Adding list subscription failed.'));
             }
 
-            $ptag = Profile_list::staticGet('id', $peopletag->id);
+            $ptag = Profile_list::getKV('id', $peopletag->id);
             $ptag->subscriberCount(true);
 
             Event::handle('EndSubscribePeopletag', array($peopletag, $profile));
@@ -114,7 +114,7 @@ class Profile_tag_subscription extends Managed_DataObject
         $subs->find();
 
         while($subs->fetch()) {
-            $profile = Profile::staticGet('id', $subs->profile_id);
+            $profile = Profile::getKV('id', $subs->profile_id);
             Event::handle('StartUnsubscribePeopletag', array($profile_list, $profile));
             // Delete anyway
             $subs->delete();
index 9e30d8b9077f77efd9267d73e1cb27d05384807f..46a187f25b8ab50901853c270478e56ed5953d5a 100644 (file)
@@ -42,7 +42,7 @@ class Remote_profile extends Managed_DataObject
 
     function hasRight($right)
     {
-        $profile = Profile::staticGet($this->id);
+        $profile = Profile::getKV($this->id);
         if ($profile) {
             return $profile->hasright($right);
         } else {
index 8323ef89f526f181e2318ad4fa0b951ff17fb428..a54151c2dfbca166e1d6732c4eab2d8022f7c8a6 100644 (file)
@@ -74,7 +74,7 @@ class Session extends Managed_DataObject
     {
         self::logdeb("Fetching session '$id'");
 
-        $session = Session::staticGet('id', $id);
+        $session = Session::getKV('id', $id);
 
         if (empty($session)) {
             self::logdeb("Couldn't find '$id'");
@@ -91,7 +91,7 @@ class Session extends Managed_DataObject
     {
         self::logdeb("Writing session '$id'");
 
-        $session = Session::staticGet('id', $id);
+        $session = Session::getKV('id', $id);
 
         if (empty($session)) {
             self::logdeb("'$id' doesn't yet exist; inserting.");
@@ -140,7 +140,7 @@ class Session extends Managed_DataObject
     {
         self::logdeb("Deleting session $id");
 
-        $session = Session::staticGet('id', $id);
+        $session = Session::getKV('id', $id);
 
         if (empty($session)) {
             self::logdeb("Can't find '$id' to delete.");
index 5a683c04d215007ed1384ef997bc34a84cd5d5c7..0376f1e69d5b59bbced5aedc9dc6f7d8e88bcecf 100644 (file)
@@ -42,7 +42,8 @@ class Status_network extends Safe_DataObject
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
 
     /* Static get */
-    static function staticGet($k,$v=NULL) {
+    static function getKV($k,$v=NULL) {
+        // TODO: This must probably be turned into a non-static call
         $i = DB_DataObject::staticGet('Status_network',$k,$v);
 
         // Don't use local process cache; if we're fetching multiple
@@ -118,7 +119,7 @@ class Status_network extends Safe_DataObject
     static function memGet($k, $v)
     {
         if (!self::$cache) {
-            return self::staticGet($k, $v);
+            return self::getKV($k, $v);
         }
 
         $ck = self::cacheKey($k, $v);
@@ -126,7 +127,7 @@ class Status_network extends Safe_DataObject
         $sn = self::$cache->get($ck);
 
         if (empty($sn)) {
-            $sn = self::staticGet($k, $v);
+            $sn = self::getKV($k, $v);
             if (!empty($sn)) {
                 self::$cache->set($ck, clone($sn));
             }
index 4a7c3b51ff15311a903f1ce4d303d80a32e4defa..ba0e7d90f253f45ad79d83741bb9fe3cba8294c4 100644 (file)
@@ -43,9 +43,13 @@ class Status_network_tag extends Safe_DataObject
         $this->_connect();
     }
 
+    /* the code above is auto generated do not remove the tag below */
+    ###END_AUTOCODE
+
     /* Static get */
-    function staticGet($k,$v=null)
+    static function getKV($k,$v=null)
     {
+        // TODO: This probably has to be converted to a non-static call
         $i = DB_DataObject::staticGet('Status_network_tag',$k,$v);
 
         // Don't use local process cache; if we're fetching multiple
@@ -56,10 +60,6 @@ class Status_network_tag extends Safe_DataObject
         return $i;
     }
 
-    /* the code above is auto generated do not remove the tag below */
-    ###END_AUTOCODE
-
-
     function pkeyGet($kv)
     {
         return Memcached_DataObject::pkeyGet('Status_network_tag', $kv);
index 7ab0136fa718a420988c22bcd6bde90b1036f65b..41d31f962fe5c565d2a8b915b172608864f6a220 100644 (file)
@@ -113,7 +113,7 @@ class Subscription extends Managed_DataObject
         }
 
         if (Event::handle('StartSubscribe', array($subscriber, $other))) {
-            $otherUser = User::staticGet('id', $other->id);
+            $otherUser = User::getKV('id', $other->id);
             if ($otherUser && $otherUser->subscribe_policy == User::SUBSCRIBE_POLICY_MODERATE && !$force) {
                 $sub = Subscription_queue::saveNew($subscriber, $other);
                 $sub->notify();
@@ -187,11 +187,11 @@ class Subscription extends Managed_DataObject
 
     function notifyEmail()
     {
-        $subscribedUser = User::staticGet('id', $this->subscribed);
+        $subscribedUser = User::getKV('id', $this->subscribed);
 
         if (!empty($subscribedUser)) {
 
-            $subscriber = Profile::staticGet('id', $this->subscriber);
+            $subscriber = Profile::getKV('id', $this->subscriber);
 
             mail_subscribe_notify_profile($subscribedUser, $subscriber);
         }
@@ -255,8 +255,8 @@ class Subscription extends Managed_DataObject
 
     function asActivity()
     {
-        $subscriber = Profile::staticGet('id', $this->subscriber);
-        $subscribed = Profile::staticGet('id', $this->subscribed);
+        $subscriber = Profile::getKV('id', $this->subscriber);
+        $subscribed = Profile::getKV('id', $this->subscribed);
 
         if (empty($subscriber)) {
             throw new Exception(sprintf(_('No profile for the subscriber: %d'), $this->subscriber));
index 8626f0674b26e28e3bca7b18b3b2c5fe5425e702..2711883539a5fe17c0f1daa48ff5f88e7ebfd8d4 100644 (file)
@@ -66,8 +66,8 @@ class Subscription_queue extends Managed_DataObject
      */
     public function complete()
     {
-        $subscriber = Profile::staticGet('id', $this->subscriber);
-        $subscribed = Profile::staticGet('id', $this->subscribed);
+        $subscriber = Profile::getKV('id', $this->subscriber);
+        $subscribed = Profile::getKV('id', $this->subscribed);
         $sub = Subscription::start($subscriber, $subscribed, Subscription::FORCE);
         if ($sub) {
             $this->delete();
@@ -80,8 +80,8 @@ class Subscription_queue extends Managed_DataObject
      */
     public function abort()
     {
-        $subscriber = Profile::staticGet('id', $this->subscriber);
-        $subscribed = Profile::staticGet('id', $this->subscribed);
+        $subscriber = Profile::getKV('id', $this->subscriber);
+        $subscribed = Profile::getKV('id', $this->subscribed);
         if (Event::handle('StartCancelSubscription', array($subscriber, $subscribed))) {
             $this->delete();
             Event::handle('EndCancelSubscription', array($subscriber, $subscribed));
@@ -94,8 +94,8 @@ class Subscription_queue extends Managed_DataObject
      */
     public function notify()
     {
-        $other = Profile::staticGet('id', $this->subscriber);
-        $listenee = User::staticGet('id', $this->subscribed);
+        $other = Profile::getKV('id', $this->subscriber);
+        $listenee = User::getKV('id', $this->subscribed);
         mail_subscribe_pending_notify_profile($listenee, $other);
     }
 }
index 2bc8c88b2ebe75772f73d0d9b520ab66e51c4fdb..c4a2288444253e2a88358c098354d3f4fd3d4aed 100644 (file)
@@ -128,7 +128,7 @@ class User extends Managed_DataObject
     function getProfile()
     {
         if (is_int($this->_profile) && $this->_profile == -1) { // invalid but distinct from null
-            $this->_profile = Profile::staticGet('id', $this->id);
+            $this->_profile = Profile::getKV('id', $this->id);
             if (empty($this->_profile)) {
                 throw new UserNoProfileException($this);
             }
@@ -222,7 +222,7 @@ class User extends Managed_DataObject
 
     function getCarrier()
     {
-        return Sms_carrier::staticGet('id', $this->carrier);
+        return Sms_carrier::getKV('id', $this->carrier);
     }
 
     /**
@@ -315,7 +315,7 @@ class User extends Managed_DataObject
         // Users who respond to invite email have proven their ownership of that address
 
         if (!empty($code)) {
-            $invite = Invitation::staticGet($code);
+            $invite = Invitation::getKV($code);
             if ($invite && $invite->address && $invite->address_type == 'email' && $invite->address == $email) {
                 $user->email = $invite->address;
             }
@@ -432,7 +432,7 @@ class User extends Managed_DataObject
             $defnick = common_config('newuser', 'default');
 
             if (!empty($defnick)) {
-                $defuser = User::staticGet('nickname', $defnick);
+                $defuser = User::getKV('nickname', $defnick);
                 if (empty($defuser)) {
                     common_log(LOG_WARNING, sprintf("Default user %s does not exist.", $defnick),
                                __FILE__);
@@ -452,7 +452,7 @@ class User extends Managed_DataObject
             $welcome = common_config('newuser', 'welcome');
 
             if (!empty($welcome)) {
-                $welcomeuser = User::staticGet('nickname', $welcome);
+                $welcomeuser = User::getKV('nickname', $welcome);
                 if (empty($welcomeuser)) {
                     common_log(LOG_WARNING, sprintf("Welcome user %s does not exist.", $defnick),
                                __FILE__);
@@ -483,7 +483,7 @@ class User extends Managed_DataObject
 
         if ($invites->find()) {
             while ($invites->fetch()) {
-                $other = User::staticGet($invites->user_id);
+                $other = User::getKV($invites->user_id);
                 subs_subscribe_to($other, $this);
             }
         }
@@ -874,7 +874,7 @@ class User extends Managed_DataObject
             $share = common_config('location', 'sharedefault');
 
             // Check if user has a personal setting for this
-            $prefs = User_location_prefs::staticGet('user_id', $this->id);
+            $prefs = User_location_prefs::getKV('user_id', $this->id);
 
             if (!empty($prefs)) {
                 $share = $prefs->share_location;
@@ -900,7 +900,7 @@ class User extends Managed_DataObject
             $pr->limit(1);
 
             if ($pr->find(true)) {
-                $owner = User::staticGet('id', $pr->profile_id);
+                $owner = User::getKV('id', $pr->profile_id);
             } else {
                 $owner = null;
             }
@@ -930,7 +930,7 @@ class User extends Managed_DataObject
             $nickname = common_config('singleuser', 'nickname');
 
             if (!empty($nickname)) {
-                $user = User::staticGet('nickname', $nickname);
+                $user = User::getKV('nickname', $nickname);
             }
 
             // if there was no nickname or no user by that nickname,
@@ -1051,11 +1051,11 @@ class User extends Managed_DataObject
 
     static function recoverPassword($nore)
     {
-        $user = User::staticGet('email', common_canonical_email($nore));
+        $user = User::getKV('email', common_canonical_email($nore));
 
         if (!$user) {
             try {
-                $user = User::staticGet('nickname', common_canonical_nickname($nore));
+                $user = User::getKV('nickname', common_canonical_nickname($nore));
             } catch (NicknameException $e) {
                 // invalid
             }
@@ -1072,7 +1072,7 @@ class User extends Managed_DataObject
             $confirm_email->address_type = 'email';
             $confirm_email->find();
             if ($confirm_email->fetch()) {
-                $user = User::staticGet($confirm_email->user_id);
+                $user = User::getKV($confirm_email->user_id);
             } else {
                 $confirm_email = null;
             }
@@ -1145,7 +1145,7 @@ class User extends Managed_DataObject
     function streamModeOnly()
     {
         if (common_config('oldschool', 'enabled')) {
-            $osp = Old_school_prefs::staticGet('user_id', $this->id);
+            $osp = Old_school_prefs::getKV('user_id', $this->id);
             if (!empty($osp)) {
                 return $osp->stream_mode_only;
             }
@@ -1157,7 +1157,7 @@ class User extends Managed_DataObject
     function conversationTree()
     {
         if (common_config('oldschool', 'enabled')) {
-            $osp = Old_school_prefs::staticGet('user_id', $this->id);
+            $osp = Old_school_prefs::getKV('user_id', $this->id);
             if (!empty($osp)) {
                 return $osp->conversation_tree;
             }
@@ -1169,7 +1169,7 @@ class User extends Managed_DataObject
     function streamNicknames()
     {
         if (common_config('oldschool', 'enabled')) {
-            $osp = Old_school_prefs::staticGet('user_id', $this->id);
+            $osp = Old_school_prefs::getKV('user_id', $this->id);
             if (!empty($osp)) {
                 return $osp->stream_nicknames;
             }
index 447dbded452811211e02d9860e9670b41d3ca2a5..8f7a0d7b586e7ffa72d58ffc98e1aa74c81e2b4e 100644 (file)
@@ -415,13 +415,13 @@ class User_group extends Managed_DataObject
 
         // If not, check local groups.
 
-        $group = Local_group::staticGet('nickname', $nickname);
+        $group = Local_group::getKV('nickname', $nickname);
         if (!empty($group)) {
-            return User_group::staticGet('id', $group->group_id);
+            return User_group::getKV('id', $group->group_id);
         }
-        $alias = Group_alias::staticGet('alias', $nickname);
+        $alias = Group_alias::getKV('alias', $nickname);
         if (!empty($alias)) {
-            return User_group::staticGet('id', $alias->group_id);
+            return User_group::getKV('id', $alias->group_id);
         }
         return null;
     }
@@ -565,7 +565,7 @@ class User_group extends Managed_DataObject
 
     static function register($fields) {
         if (!empty($fields['userid'])) {
-            $profile = Profile::staticGet('id', $fields['userid']);
+            $profile = Profile::getKV('id', $fields['userid']);
             if ($profile && !$profile->hasRight(Right::CREATEGROUP)) {
                 common_log(LOG_WARNING, "Attempted group creation from banned user: " . $profile->nickname);
 
@@ -736,7 +736,7 @@ class User_group extends Managed_DataObject
             // or we'll miss clearing some cache keys; that can make it hard
             // to create a new group with one of those names or aliases.
             $this->setAliases(array());
-            $local = Local_group::staticGet('group_id', $this->id);
+            $local = Local_group::getKV('group_id', $this->id);
             if ($local) {
                 $local->delete();
             }
index 600e4e1ac2f2a61b3fcb0ad119db9ca74eaf49b9..9cb5a4cb0e5b2c0231e9e2a13c2ad215d2964819 100755 (executable)
@@ -109,7 +109,7 @@ class User_urlshortener_prefs extends Managed_DataObject
             return null;
         }
 
-        $prefs = User_urlshortener_prefs::staticGet('user_id', $user->id);
+        $prefs = User_urlshortener_prefs::getKV('user_id', $user->id);
 
         return $prefs;
     }
index f49c73aeab62f51448cc8cc72e810a058dfa2651..c63bded46a7f5392c0c81691d39920fbb74c79f8 100644 (file)
@@ -55,7 +55,7 @@ class AccountProfileBlock extends ProfileBlock
     {
         parent::__construct($out);
         $this->profile = $profile;
-        $this->user    = User::staticGet('id', $profile->id);
+        $this->user    = User::getKV('id', $profile->id);
     }
 
     function avatar()
index 71fd7407e21e976df9b7ce88e4866356e609947f..8e0f7be94a68bd28f51ab2e02b66d36c4d395754 100644 (file)
@@ -545,7 +545,7 @@ class Action extends HTMLOutputter // lawsuit
                     // if logo is an uploaded file, try to fall back to HTTPS file URL
                     $httpUrl = common_config('site', 'logo');
                     if (!empty($httpUrl)) {
-                        $f = File::staticGet('url', $httpUrl);
+                        $f = File::getKV('url', $httpUrl);
                         if (!empty($f) && !empty($f->filename)) {
                             // this will handle the HTTPS case
                             $logoUrl = File::url($f->filename);
index 096eb9ba435c268082312270db195dcd0c75681b..c2bdc447b5bca6798a63fffe45d78ee1498a96b6 100644 (file)
@@ -102,7 +102,7 @@ class ActivityImporter extends QueueHandler
             }
 
             $other = $activity->actor;
-            $otherUser = User::staticGet('uri', $other->id);
+            $otherUser = User::getKV('uri', $other->id);
 
             if (!empty($otherUser)) {
                 $otherProfile = $otherUser->getProfile();
@@ -139,7 +139,7 @@ class ActivityImporter extends QueueHandler
 
         $uri = $activity->objects[0]->id;
 
-        $group = User_group::staticGet('uri', $uri);
+        $group = User_group::getKV('uri', $uri);
 
         if (empty($group)) {
             $oprofile = Ostatus_profile::ensureActivityObjectProfile($activity->objects[0]);
@@ -168,7 +168,7 @@ class ActivityImporter extends QueueHandler
 
         $sourceUri = $note->id;
 
-        $notice = Notice::staticGet('uri', $sourceUri);
+        $notice = Notice::getKV('uri', $sourceUri);
 
         if (!empty($notice)) {
 
@@ -244,7 +244,7 @@ class ActivityImporter extends QueueHandler
             // Maintain direct reply associations
             // @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;
@@ -299,7 +299,7 @@ class ActivityImporter extends QueueHandler
 
             // Is the recipient a local user?
 
-            $user = User::staticGet('uri', $recipient);
+            $user = User::getKV('uri', $recipient);
 
             if ($user) {
                 // @fixme sender verification, spam etc?
@@ -320,11 +320,11 @@ class ActivityImporter extends QueueHandler
 
             // Is the recipient a local group?
             // @fixme uri on user_group isn't reliable yet
-            // $group = User_group::staticGet('uri', $recipient);
+            // $group = User_group::getKV('uri', $recipient);
             $id = OStatusPlugin::localGroupFromUrl($recipient);
 
             if ($id) {
-                $group = User_group::staticGet('id', $id);
+                $group = User_group::getKV('id', $id);
                 if ($group) {
                     // Deliver to all members of this local group if allowed.
                     $profile = $sender->localProfile();
index 6d9d77b215e08be1a61d3c2ae2b0d2d026bbe7fd..d5edab5caacb007b73c9fb9745a82a5c3aace820 100644 (file)
@@ -55,7 +55,7 @@ class ActivityMover extends QueueHandler
     {
         list ($act, $sink, $userURI, $remoteURI) = $data;
 
-        $user   = User::staticGet('uri', $userURI);
+        $user   = User::getKV('uri', $userURI);
         $remote = Profile::fromURI($remoteURI);
 
         try {
@@ -92,7 +92,7 @@ class ActivityMover extends QueueHandler
                        "{$act->actor->id} to {$remote->nickname}.");
             // push it, then delete local
             $sink->postActivity($act);
-            $notice = Notice::staticGet('uri', $act->objects[0]->id);
+            $notice = Notice::getKV('uri', $act->objects[0]->id);
             if (!empty($notice)) {
                 $fave = Fave::pkeyGet(array('user_id' => $user->id,
                                             'notice_id' => $notice->id));
@@ -105,7 +105,7 @@ class ActivityMover extends QueueHandler
                        "{$act->actor->id} to {$remote->nickname}.");
             // XXX: send a reshare, not a post
             $sink->postActivity($act);
-            $notice = Notice::staticGet('uri', $act->objects[0]->id);
+            $notice = Notice::getKV('uri', $act->objects[0]->id);
             if (!empty($notice)) {
                 $notice->delete();
             }
@@ -115,7 +115,7 @@ class ActivityMover extends QueueHandler
                        "Moving group join of {$act->objects[0]->id} by ".
                        "{$act->actor->id} to {$remote->nickname}.");
             $sink->postActivity($act);
-            $group = User_group::staticGet('uri', $act->objects[0]->id);
+            $group = User_group::getKV('uri', $act->objects[0]->id);
             if (!empty($group)) {
                 $user->leaveGroup($group);
             }
@@ -131,7 +131,7 @@ class ActivityMover extends QueueHandler
                     Subscription::cancel($user->getProfile(), $other);
                 }
             } else {
-                $otherUser = User::staticGet('uri', $act->actor->id);
+                $otherUser = User::getKV('uri', $act->actor->id);
                 if (!empty($otherUser)) {
                     $this->log(LOG_INFO,
                                "Changing sub to {$act->objects[0]->id}".
index 5a42a1dfb3431b847fd1804df9666efdeb699fde..ee69e1c7623001615852a8b8ef2d7be4e9f89105 100644 (file)
@@ -553,7 +553,7 @@ class ActivityObject
             $object->title   = $ptag->tag;
             $object->summary = $ptag->description;
             $object->link    = $ptag->homeUrl();
-            $object->owner   = Profile::staticGet('id', $ptag->tagger);
+            $object->owner   = Profile::getKV('id', $ptag->tagger);
             $object->poco    = PoCo::fromProfile($object->owner);
             Event::handle('EndActivityObjectFromPeopletag', array($ptag, &$object));
         }
index 14e21ae4fdc15f8ad8980862bc473a57d8e16fd8..edd184934fb2c35d294040086874977f100c7e51 100644 (file)
@@ -279,7 +279,7 @@ class ApiAction extends Action
         $base = $this->twitterSimpleStatusArray($notice, $include_user);
 
         if (!empty($notice->repeat_of)) {
-            $original = Notice::staticGet('id', $notice->repeat_of);
+            $original = Notice::getKV('id', $notice->repeat_of);
             if (!empty($original)) {
                 $original_array = $this->twitterSimpleStatusArray($original, $include_user);
                 $base['retweeted_status'] = $original_array;
@@ -321,7 +321,7 @@ class ApiAction extends Action
         $replier_profile = null;
 
         if ($notice->reply_to) {
-            $reply = Notice::staticGet(intval($notice->reply_to));
+            $reply = Notice::getKV(intval($notice->reply_to));
             if ($reply) {
                 $replier_profile = $reply->getProfile();
             }
@@ -431,7 +431,7 @@ class ApiAction extends Action
 
     function twitterListArray($list)
     {
-        $profile = Profile::staticGet('id', $list->tagger);
+        $profile = Profile::getKV('id', $list->tagger);
 
         $twitter_list = array();
         $twitter_list['id'] = $list->id;
@@ -1468,29 +1468,29 @@ class ApiAction extends Action
         if (empty($id)) {
             // Twitter supports these other ways of passing the user ID
             if (self::is_decimal($this->arg('id'))) {
-                return User::staticGet($this->arg('id'));
+                return User::getKV($this->arg('id'));
             } else if ($this->arg('id')) {
                 $nickname = common_canonical_nickname($this->arg('id'));
-                return User::staticGet('nickname', $nickname);
+                return User::getKV('nickname', $nickname);
             } else if ($this->arg('user_id')) {
                 // This is to ensure that a non-numeric user_id still
                 // overrides screen_name even if it doesn't get used
                 if (self::is_decimal($this->arg('user_id'))) {
-                    return User::staticGet('id', $this->arg('user_id'));
+                    return User::getKV('id', $this->arg('user_id'));
                 }
             } else if ($this->arg('screen_name')) {
                 $nickname = common_canonical_nickname($this->arg('screen_name'));
-                return User::staticGet('nickname', $nickname);
+                return User::getKV('nickname', $nickname);
             } else {
                 // Fall back to trying the currently authenticated user
                 return $this->auth_user;
             }
 
         } else if (self::is_decimal($id)) {
-            return User::staticGet($id);
+            return User::getKV($id);
         } else {
             $nickname = common_canonical_nickname($id);
-            return User::staticGet('nickname', $nickname);
+            return User::getKV('nickname', $nickname);
         }
     }
 
@@ -1500,28 +1500,28 @@ class ApiAction extends Action
 
             // Twitter supports these other ways of passing the user ID
             if (self::is_decimal($this->arg('id'))) {
-                return Profile::staticGet($this->arg('id'));
+                return Profile::getKV($this->arg('id'));
             } else if ($this->arg('id')) {
                 // Screen names currently can only uniquely identify a local user.
                 $nickname = common_canonical_nickname($this->arg('id'));
-                $user = User::staticGet('nickname', $nickname);
+                $user = User::getKV('nickname', $nickname);
                 return $user ? $user->getProfile() : null;
             } else if ($this->arg('user_id')) {
                 // This is to ensure that a non-numeric user_id still
                 // overrides screen_name even if it doesn't get used
                 if (self::is_decimal($this->arg('user_id'))) {
-                    return Profile::staticGet('id', $this->arg('user_id'));
+                    return Profile::getKV('id', $this->arg('user_id'));
                 }
             } else if ($this->arg('screen_name')) {
                 $nickname = common_canonical_nickname($this->arg('screen_name'));
-                $user = User::staticGet('nickname', $nickname);
+                $user = User::getKV('nickname', $nickname);
                 return $user ? $user->getProfile() : null;
             }
         } else if (self::is_decimal($id)) {
-            return Profile::staticGet($id);
+            return Profile::getKV($id);
         } else {
             $nickname = common_canonical_nickname($id);
-            $user = User::staticGet('nickname', $nickname);
+            $user = User::getKV('nickname', $nickname);
             return $user ? $user->getProfile() : null;
         }
     }
@@ -1530,21 +1530,21 @@ class ApiAction extends Action
     {
         if (empty($id)) {
             if (self::is_decimal($this->arg('id'))) {
-                return User_group::staticGet('id', $this->arg('id'));
+                return User_group::getKV('id', $this->arg('id'));
             } else if ($this->arg('id')) {
                 return User_group::getForNickname($this->arg('id'));
             } else if ($this->arg('group_id')) {
                 // This is to ensure that a non-numeric group_id still
                 // overrides group_name even if it doesn't get used
                 if (self::is_decimal($this->arg('group_id'))) {
-                    return User_group::staticGet('id', $this->arg('group_id'));
+                    return User_group::getKV('id', $this->arg('group_id'));
                 }
             } else if ($this->arg('group_name')) {
                 return User_group::getForNickname($this->arg('group_name'));
             }
 
         } else if (self::is_decimal($id)) {
-            return User_group::staticGet('id', $id);
+            return User_group::getKV('id', $id);
         } else {
             return User_group::getForNickname($id);
         }
@@ -1561,7 +1561,7 @@ class ApiAction extends Action
 
         if($id) {
             if (is_numeric($id)) {
-                $list = Profile_list::staticGet('id', $id);
+                $list = Profile_list::getKV('id', $id);
 
                 // only if the list with the id belongs to the tagger
                 if(empty($list) || $list->tagger != $tagger->id) {
index 1061e6b68c0b6a9d6c034d3b2e4604e1a26c3c6f..ecb206bab1b58172684bd654fa81eabe723d3f75 100644 (file)
@@ -183,7 +183,7 @@ class ApiAuthAction extends ApiAction
             }
 
 
-            $appUser = Oauth_application_user::staticGet('token', $access_token);
+            $appUser = Oauth_application_user::getKV('token', $access_token);
 
             if (!empty($appUser)) {
                 // If access_type == 0 we have either a request token
@@ -196,7 +196,7 @@ class ApiAuthAction extends ApiAction
 
                     // Set the auth user
                     if (Event::handle('StartSetApiUser', array(&$user))) {
-                        $user = User::staticGet('id', $appUser->profile_id);
+                        $user = User::getKV('id', $appUser->profile_id);
                         if (!empty($user)) {
                             if (!$user->hasRight(Right::API)) {
                                 // TRANS: Authorization exception thrown when a user without API access tries to access the API.
index ca7dce83282a06136b970d42d30f83f21f7553a1..ee968590e80cd0967d8953da02d15448dff842cd 100644 (file)
@@ -202,7 +202,7 @@ class ConnectedAppsList extends Widget
 
     function showConnection()
     {
-        $app = Oauth_application::staticGet('id', $this->connection->application_id);
+        $app = Oauth_application::getKV('id', $this->connection->application_id);
 
         $this->out->elementStart(
             'li',
index ee4f01cad403604ecff866b4ebea9eb707b0e08d..601e83294ff1440fb624e49a3c1915cb4eefdb43 100644 (file)
@@ -59,7 +59,7 @@ class AtomListNoticeFeed extends AtomNoticeFeed
     function __construct($list, $cur = null, $indent = true) {
         parent::__construct($cur, $indent);
         $this->list = $list;
-        $this->tagger = Profile::staticGet('id', $list->tagger);
+        $this->tagger = Profile::getKV('id', $list->tagger);
 
         // TRANS: Title in atom list notice feed. %1$s is a list name, %2$s is a tagger's nickname.
         $title = sprintf(_('Timeline for people in list %1$s by %2$s'), $list->tag, $this->tagger->nickname);
index a93a6842bbe32648c009f735a0fab7d325bbf5f6..1d5be73714ada190a4690412b29918137e6077e4 100644 (file)
@@ -152,7 +152,7 @@ class AttachmentListItem extends Widget
     {
         parent::__construct($out);
         $this->attachment  = $attachment;
-        $this->oembed = File_oembed::staticGet('file_id', $this->attachment->id);
+        $this->oembed = File_oembed::getKV('file_id', $this->attachment->id);
     }
 
     function title() {
@@ -222,7 +222,7 @@ class AttachmentListItem extends Widget
      */
     function getThumbInfo()
     {
-        $thumbnail = File_thumbnail::staticGet('file_id', $this->attachment->id);
+        $thumbnail = File_thumbnail::getKV('file_id', $this->attachment->id);
         if ($thumbnail) {
             $maxWidth = common_config('attachments', 'thumb_width');
             $maxHeight = common_config('attachments', 'thumb_height');
index 5e878c155b0ddceb7acc8bb3fe2e979e065db102..ad031e785240941a2516d7ed20c9af719ee0bfce 100644 (file)
@@ -128,12 +128,12 @@ abstract class AuthenticationPlugin extends Plugin
     {
         if($provider_name == $this->provider_name && $this->autoregistration){
             $suggested_nickname = $this->suggestNicknameForUsername($nickname);
-            $test_user = User::staticGet('nickname', $suggested_nickname);
+            $test_user = User::getKV('nickname', $suggested_nickname);
             if($test_user) {
                 //someone already exists with the suggested nickname, so used the passed nickname
                 $suggested_nickname = common_nicknamize($nickname);
             }
-            $test_user = User::staticGet('nickname', $suggested_nickname);
+            $test_user = User::getKV('nickname', $suggested_nickname);
             if($test_user) {
                 //someone already exists with the suggested nickname
                 //not much else we can do
@@ -155,14 +155,14 @@ abstract class AuthenticationPlugin extends Plugin
         if($user_username->find() && $user_username->fetch()){
             $authenticated = $this->checkPassword($user_username->username, $password);
             if($authenticated){
-                $authenticatedUser = User::staticGet('id', $user_username->user_id);
+                $authenticatedUser = User::getKV('id', $user_username->user_id);
                 return false;
             }
         }else{
             //$nickname is the username used to login
             //$suggested_nickname is the nickname the auth provider suggests for that username
             $suggested_nickname = $this->suggestNicknameForUsername($nickname);
-            $user = User::staticGet('nickname', $suggested_nickname);
+            $user = User::getKV('nickname', $suggested_nickname);
             if($user){
                 //make sure this user isn't claimed
                 $user_username = new User_username();
index f51cbbb5f76f78362ae1fe21407596c15a42f458..ae97b9facd31c3dd8801002d4901735a883940f2 100644 (file)
@@ -76,7 +76,7 @@ class Command
             if(substr($this->other,0,1)=='#'){
                 // A specific notice_id #123
 
-                $notice = Notice::staticGet(substr($arg,1));
+                $notice = Notice::getKV(substr($arg,1));
                 if (!$notice) {
                     // TRANS: Command exception text shown when a notice ID is requested that does not exist.
                     throw new CommandException(_('Notice with that id does not exist.'));
@@ -85,7 +85,7 @@ class Command
 
             if (Validate::uri($this->other)) {
                 // A specific notice by URI lookup
-                $notice = Notice::staticGet('uri', $arg);
+                $notice = Notice::getKV('uri', $arg);
             }
 
             if (!$notice) {
@@ -139,7 +139,7 @@ class Command
     {
         $user = null;
         if (Event::handle('StartCommandGetUser', array($this, $arg, &$user))) {
-            $user = User::staticGet('nickname', Nickname::normalize($arg));
+            $user = User::getKV('nickname', Nickname::normalize($arg));
         }
         Event::handle('EndCommandGetUser', array($this, $arg, &$user));
         if (!$user){
@@ -310,7 +310,7 @@ class FavCommand extends Command
         // @fixme favorite notification should be triggered
         // at a lower level
 
-        $other = User::staticGet('id', $notice->profile_id);
+        $other = User::getKV('id', $notice->profile_id);
 
         if ($other && $other->id != $this->user->id) {
             if ($other->email && $other->emailnotifyfav) {
@@ -770,7 +770,7 @@ class SubCommand extends Command
 
         $target = $this->getProfile($this->other);
 
-        $remote = Remote_profile::staticGet('id', $target->id);
+        $remote = Remote_profile::getKV('id', $target->id);
         if ($remote) {
             // TRANS: Command exception text shown when trying to subscribe to an OMB profile using the subscribe command.
             throw new CommandException(_("Can't subscribe to OMB profiles by command."));
index 710303938264995a8e77678d8ad3b0cc44b54540..1baaf9331f2bf7e9752ec8565ca6ab08c1efd511 100644 (file)
@@ -43,7 +43,7 @@ class DelUserQueueHandler extends QueueHandler
             return true;
         }
 
-        $user = User::staticGet('id', $user->id);
+        $user = User::getKV('id', $user->id);
         if (!$user) {
             common_log(LOG_INFO, "User {$user->nickname} was deleted before we got here.");
             return true;
index 466093534e2898aa5864e07b807aaa989f9eb315..b5807ee8b45d82384fe98e355a4f9cba864387dd 100644 (file)
@@ -142,7 +142,7 @@ class FeedImporter extends QueueHandler
 
     function userFromAuthor($author)
     {
-        $user = User::staticGet('uri', $author->id);
+        $user = User::getKV('uri', $author->id);
 
         if (empty($user)) {
             $attrs =
index 51bb9e3e1a17d17e2af83c2eda6ccea0f6f38cef..85e3f0de3ebb6e2e6b016ad79b0f9307d5dde90e 100644 (file)
@@ -54,7 +54,7 @@ class GalleryAction extends ProfileAction
             return false;
         }
 
-        $this->user = User::staticGet('nickname', $nickname);
+        $this->user = User::getKV('nickname', $nickname);
 
         if (!$this->user) {
             // TRANS: Client error displayed when trying to perform a gallery action with an unknown user.
index a5e62a2a5a523f3e3ea456bd4a833a4fcc0931ef..6e33cb321be31d0151c3d0992adb29ac3d4dafae 100644 (file)
@@ -70,10 +70,10 @@ class GroupAction extends Action
             return false;
         }
 
-        $local = Local_group::staticGet('nickname', $nickname);
+        $local = Local_group::getKV('nickname', $nickname);
 
         if (!$local) {
-            $alias = Group_alias::staticGet('alias', $nickname);
+            $alias = Group_alias::getKV('alias', $nickname);
             if ($alias) {
                 $args = array('id' => $alias->group_id);
                 if ($this->page != 1) {
@@ -89,7 +89,7 @@ class GroupAction extends Action
             }
         }
 
-        $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 if no local group with a given name was found requesting group page.
index a0378603916e01d36ff0bf486c63111dfe4a8b13..3eba3469fd80517704f964d910736a52789da5a7 100644 (file)
@@ -170,7 +170,7 @@ abstract class ImPlugin extends Plugin
     {
         $user_im_prefs = $this->getUserImPrefsFromScreenname($screenname);
         if($user_im_prefs){
-            $user = User::staticGet('id', $user_im_prefs->user_id);
+            $user = User::getKV('id', $user_im_prefs->user_id);
             $user_im_prefs->free();
             return $user;
         }else{
@@ -321,7 +321,7 @@ abstract class ImPlugin extends Plugin
         $ni = $notice->whoGets();
 
         foreach ($ni as $user_id => $reason) {
-            $user = User::staticGet($user_id);
+            $user = User::getKV($user_id);
             if (empty($user)) {
                 // either not a local user, or just not found
                 continue;
@@ -535,7 +535,7 @@ abstract class ImPlugin extends Plugin
 
     function onStartEnqueueNotice($notice, &$transports)
     {
-        $profile = Profile::staticGet($notice->profile_id);
+        $profile = Profile::getKV($notice->profile_id);
 
         if (!$profile) {
             common_log(LOG_WARNING, 'Refusing to broadcast notice with ' .
index 58b007505084baa76ab557c23d48249ff69406c4..fee0e8a096ba608221dc080438e60da9886edf97 100644 (file)
@@ -57,7 +57,7 @@ class InboxNoticeStream extends ScopingNoticeStream
             $profile = Profile::current();
         }
         // Note: we don't use CachingNoticeStream since RawInboxNoticeStream
-        // uses Inbox::staticGet(), which is cached.
+        // uses Inbox::getKV(), which is cached.
         parent::__construct(new RawInboxNoticeStream($user), $profile);
     }
 }
@@ -85,7 +85,7 @@ class RawInboxNoticeStream extends NoticeStream
     function __construct($user)
     {
         $this->user  = $user;
-        $this->inbox = Inbox::staticGet('user_id', $user->id);
+        $this->inbox = Inbox::getKV('user_id', $user->id);
     }
 
     /**
index c9b2705991f91e262f9ce53690f97e45c28d6754..7ae2b9953c0e1d63c78948d2ae101dbf5ad7cac6 100644 (file)
@@ -217,7 +217,7 @@ class ResultItem
         $replier_profile = null;
 
         if ($this->notice->reply_to) {
-            $reply = Notice::staticGet(intval($this->notice->reply_to));
+            $reply = Notice::getKV(intval($this->notice->reply_to));
             if ($reply) {
                 $replier_profile = $reply->getProfile();
             }
@@ -273,7 +273,7 @@ class ResultItem
         case 'api':
             break;
         default:
-            $ns = Notice_source::staticGet($source);
+            $ns = Notice_source::getKV($source);
             if ($ns) {
                 $source_name = '<a href="' . $ns->url . '">' . $ns->name . '</a>';
             }
index 223721a34547a9630405557f9f10a88d924a827e..9ba4b0311c6176f13c3ef43be7060eeb57624d44 100644 (file)
@@ -609,11 +609,11 @@ function mail_notify_nudge($from, $to)
 function mail_notify_message($message, $from=null, $to=null)
 {
     if (is_null($from)) {
-        $from = User::staticGet('id', $message->from_profile);
+        $from = User::getKV('id', $message->from_profile);
     }
 
     if (is_null($to)) {
-        $to = User::staticGet('id', $message->to_profile);
+        $to = User::getKV('id', $message->to_profile);
     }
 
     if (is_null($to->email) || !$to->emailnotifymsg) {
@@ -824,7 +824,7 @@ function mail_notify_group_join($group, $joiner)
     $admin = $group->getAdmins();
     while ($admin->fetch()) {
         // We need a local user for email notifications...
-        $adminUser = User::staticGet('id', $admin->id);
+        $adminUser = User::getKV('id', $admin->id);
         // @fixme check for email preference?
         if ($adminUser && $adminUser->email) {
             // use the recipient's localization
@@ -871,7 +871,7 @@ function mail_notify_group_join_pending($group, $joiner)
     $admin = $group->getAdmins();
     while ($admin->fetch()) {
         // We need a local user for email notifications...
-        $adminUser = User::staticGet('id', $admin->id);
+        $adminUser = User::getKV('id', $admin->id);
         // @fixme check for email preference?
         if ($adminUser && $adminUser->email) {
             // use the recipient's localization
index db686a255a757f8b75a845dc82a8e0f3ea8e7815..b1720fc82478dd033f534a2cdd6a115bff835d83 100644 (file)
@@ -51,7 +51,7 @@ class MailboxAction extends Action
         parent::prepare($args);
 
         $nickname   = common_canonical_nickname($this->arg('nickname'));
-        $this->user = User::staticGet('nickname', $nickname);
+        $this->user = User::getKV('nickname', $nickname);
         $this->page = $this->trimmed('page');
 
         if (!$this->page) {
index 65c5622de37a5d98edc4e9260e06403fe25c3656..75e4e1c1e48424494d0c22388e7a2d9bb61da894 100644 (file)
@@ -109,9 +109,9 @@ class MailHandler
         }
         $from = $froms[0];
         $addr = common_canonical_email($from['address']);
-        $user = User::staticGet('email', $addr);
+        $user = User::getKV('email', $addr);
         if (!$user) {
-            $user = User::staticGet('smsemail', $addr);
+            $user = User::getKV('smsemail', $addr);
         }
         return $user;
     }
index caa902de5dfeb13c18413372769198b9af209241..e5d699b5d2eddb3370669700f077dcb3c6069178 100644 (file)
@@ -158,7 +158,7 @@ class MediaFile
 
     function maybeAddRedir($file_id, $url)
     {
-        $file_redir = File_redirection::staticGet('url', $url);
+        $file_redir = File_redirection::getKV('url', $url);
 
         if (empty($file_redir)) {
 
index ba8cf834afd5cde02a694e422f811233e885ae69..9c9a0335c61d00f1dd7f5fb84f784efadb4f6493 100644 (file)
@@ -175,7 +175,7 @@ abstract class MessageListItem extends Widget
             $this->out->element('span', 'device', $source_name);
             break;
         default:
-            $ns = Notice_source::staticGet($source);
+            $ns = Notice_source::getKV($source);
             if ($ns) {
                 $this->out->elementStart('span', 'device');
                 $this->out->element('a', array('href' => $ns->url,
index 11058ad1ac80300e7ebf3d26bdec8773de9b2fd0..30542ffa73b79d57db57d45b3045e93494f34947 100644 (file)
@@ -399,7 +399,7 @@ abstract class MicroAppPlugin extends Plugin
                 $uri      = $target->uri;
                 $original = null;
                 if (!empty($activity->context->replyToID)) {
-                    $original = Notice::staticGet('uri',
+                    $original = Notice::getKV('uri',
                                                   $activity->context->replyToID);
                 }
                 if (!in_array($uri, $activity->context->attention) &&
index bc47dd1bd3b531621cf01b0c59950419165d7d7b..6a0720821d62958fd0a47aee810f738fa7065186 100644 (file)
@@ -131,7 +131,7 @@ class NoticeForm extends Form
 
         if (empty($this->to_profile) &&
             !empty($this->inreplyto)) {
-            $notice = Notice::staticGet('id', $this->inreplyto);
+            $notice = Notice::getKV('id', $this->inreplyto);
             if (!empty($notice)) {
                 $this->to_profile = $notice->getProfile();
             }
index 08053bceb6b45cf4fa7645eccf48425ede628049..f829f963ee3f8ddb30ab61a7158941625416b50f 100644 (file)
@@ -73,7 +73,7 @@ class NoticeListItem extends Widget
     {
         parent::__construct($out);
         if (!empty($notice->repeat_of)) {
-            $original = Notice::staticGet('id', $notice->repeat_of);
+            $original = Notice::getKV('id', $notice->repeat_of);
             if (empty($original)) { // could have been deleted
                 $this->notice = $notice;
             } else {
@@ -571,7 +571,7 @@ class NoticeListItem extends Widget
     function showContext()
     {
         if ($this->notice->hasConversation()) {
-            $conv = Conversation::staticGet(
+            $conv = Conversation::getKV(
                 'id',
                 $this->notice->conversation
             );
@@ -607,7 +607,7 @@ class NoticeListItem extends Widget
     {
         if (!empty($this->repeat)) {
 
-            $repeater = Profile::staticGet('id', $this->repeat->profile_id);
+            $repeater = Profile::getKV('id', $this->repeat->profile_id);
 
             $attrs = array('href' => $repeater->profileurl,
                            'class' => 'url');
index 3dd8dafeddd579f0df38fc593ea0873347dc0ea9..c984880e2ac41aa878c0204cf2bf960543ba6124 100644 (file)
@@ -64,7 +64,7 @@ class PeopletagEditForm extends Form
         parent::__construct($out);
 
         $this->peopletag = $peopletag;
-        $this->tagger    = Profile::staticGet('id', $peopletag->tagger);
+        $this->tagger    = Profile::getKV('id', $peopletag->tagger);
     }
 
     /**
index 70f7f5a425baf1926f154fd37e714b46e5382973..bbfe4eca7e082711a74c52b821341a432a1ea535 100644 (file)
@@ -89,7 +89,7 @@ class PeopletagGroupNav extends Widget
         $tag = $this->action->trimmed('tag');
 
         if ($nickname) {
-            $user = User::staticGet('nickname', $nickname);
+            $user = User::getKV('nickname', $nickname);
             $user_profile = $user->getProfile();
 
             if ($tag) {
index 986712f51d04555f4b42307feb8baca0f907da9a..2d0797f85686000b6887ea3e61aca76c32cf5a5a 100644 (file)
@@ -107,7 +107,7 @@ class PeopletagListItem extends Widget
         parent::__construct($out);
         $this->peopletag  = $peopletag;
         $this->current = $current;
-        $this->profile = Profile::staticGet('id', $this->peopletag->tagger);
+        $this->profile = Profile::getKV('id', $this->peopletag->tagger);
     }
 
     /**
index 45866b52f9bde88a5d855bf16f3e998375891ad3..7197121815efba0470b0dd4f808485c85116c0f5 100644 (file)
@@ -70,7 +70,7 @@ class ProfileAction extends Action
             return false;
         }
 
-        $this->user = User::staticGet('nickname', $nickname);
+        $this->user = User::getKV('nickname', $nickname);
 
         if (!$this->user) {
             // TRANS: Client error displayed when calling a profile action without specifying a user.
index b5f2e5d2a31232c3773d193dc2e9b3818fad4bc9..4c738523a40b6846d5c05a0d534aa010e6da8336 100644 (file)
@@ -80,7 +80,7 @@ class ProfileFormAction extends RedirectingAction
             return false;
         }
 
-        $this->profile = Profile::staticGet('id', $id);
+        $this->profile = Profile::getKV('id', $id);
 
         if (!$this->profile) {
             // TRANS: Client error displayed when trying to change user options without specifying an existing user to work on.
index 0cf088a7020198d9f5ea1491d2b08967cac155f6..e299fccaf4a3254b88cb3ecc8508e78b963573dc 100644 (file)
@@ -82,7 +82,7 @@ class ProfileNoticeStream extends ScopingNoticeStream
 
     function impossibleStream() 
     {
-        $user = User::staticGet('id', $this->streamProfile->id);
+        $user = User::getKV('id', $this->streamProfile->id);
 
         // If it's a private stream, and no user or not a subscriber
 
index cd785165289b4085ef40fee3920b8d52fe3dacce..6a40daa65ab2b9c86f5955c8e051944e516a5b33 100644 (file)
@@ -148,7 +148,7 @@ class StatusNet
             return true;
         }
 
-        $sn = Status_network::staticGet('nickname', $nickname);
+        $sn = Status_network::getKV('nickname', $nickname);
         if (empty($sn)) {
             return false;
             throw new Exception("No such site nickname '$nickname'");
index 341e32d857bd5a2c86b9159e533bf254133a9464..bcf6a180aa596b511e16651a59c2fdd9531af5f1 100644 (file)
@@ -28,7 +28,7 @@ class ApiStatusNetOAuthDataStore extends OAuthDataStore
 {
     function lookup_consumer($consumerKey)
     {
-        $con = Consumer::staticGet('consumer_key', $consumerKey);
+        $con = Consumer::getKV('consumer_key', $consumerKey);
 
         if (!$con) {
 
@@ -146,7 +146,7 @@ class ApiStatusNetOAuthDataStore extends OAuthDataStore
             common_debug('Request token found.', __FILE__);
 
             // find the app and profile associated with this token
-            $tokenAssoc = Oauth_token_association::staticGet('token', $rt->tok);
+            $tokenAssoc = Oauth_token_association::getKV('token', $rt->tok);
 
             if (!$tokenAssoc) {
                 throw new Exception(
index 7dd3e6961e005857bf5bbb729a2d4d11cf8ccf2f..5b1f8f3d9183acd4d840a66a1844849ddcb80fb3 100644 (file)
@@ -656,7 +656,7 @@ class StompQueueManager extends QueueManager
      */
     protected function updateSiteConfig($nickname)
     {
-        $sn = Status_network::staticGet('nickname', $nickname);
+        $sn = Status_network::getKV('nickname', $nickname);
         if ($sn) {
             $this->switchSite($nickname);
             if (!in_array($nickname, $this->sites)) {
index f0854767d6cc153657a2333c2bada01328bb73ae..8621590ad68acfcaa258d236a46ff5cbf6613974 100644 (file)
@@ -89,7 +89,7 @@ class ThreadedNoticeList extends NoticeList
             // Collapse repeats into their originals...
             
             if ($notice->repeat_of) {
-                $orig = Notice::staticGet('id', $notice->repeat_of);
+                $orig = Notice::getKV('id', $notice->repeat_of);
                 if ($orig) {
                     $notice = $orig;
                 }
@@ -436,7 +436,7 @@ abstract class NoticeListActorsItem extends NoticeListItem
                 // TRANS: Reference to the logged in user in favourite list.
                 array_unshift($links, _m('FAVELIST', 'You'));
             } else {
-                $profile = Profile::staticGet('id', $id);
+                $profile = Profile::getKV('id', $id);
                 if ($profile) {
                     $links[] = sprintf('<a href="%s">%s</a>',
                                        htmlspecialchars($profile->profileurl),
index ba9593f0b33bfb2b62a64bbbcbba0e959b5f5e47..b01948ed621fc90a4c709c4ba1a5e73cd3624402 100644 (file)
@@ -145,7 +145,7 @@ class ToSelector extends Widget
             }
             break;
         case 'profile':
-            $profile = Profile::staticGet('id', $value);
+            $profile = Profile::getKV('id', $value);
             $options['replies'] = array($profile->getUri());
             if ($private) {
                 $options['scope'] = Notice::ADDRESSEE_SCOPE;
index 4a87f9a2171e16d579b541a3a0bdb723d6aa7b27..bda78afe13f9de41a21287b317a1b87393cb8795 100644 (file)
@@ -235,9 +235,9 @@ function common_check_user($nickname, $password)
     if (Event::handle('StartCheckPassword', array($nickname, $password, &$authenticatedUser))) {
 
         if (common_is_email($nickname)) {
-            $user = User::staticGet('email', common_canonical_email($nickname));
+            $user = User::getKV('email', common_canonical_email($nickname));
         } else {
-            $user = User::staticGet('nickname', common_canonical_nickname($nickname));
+            $user = User::getKV('nickname', common_canonical_nickname($nickname));
         }
 
         if (!empty($user)) {
@@ -315,7 +315,7 @@ function common_set_user($user)
         return true;
     } else if (is_string($user)) {
         $nickname = $user;
-        $user = User::staticGet('nickname', $nickname);
+        $user = User::getKV('nickname', $nickname);
     } else if (!($user instanceof User)) {
         return false;
     }
@@ -413,7 +413,7 @@ function common_remembered_user()
         return null;
     }
 
-    $rm = Remember_me::staticGet('code', $code);
+    $rm = Remember_me::getKV('code', $code);
 
     if (!$rm) {
         common_log(LOG_WARNING, 'No such remember code: ' . $code);
@@ -427,7 +427,7 @@ function common_remembered_user()
         return null;
     }
 
-    $user = User::staticGet('id', $rm->user_id);
+    $user = User::getKV('id', $rm->user_id);
 
     if (!$user) {
         common_log(LOG_WARNING, 'No such user for rememberme: ' . $rm->user_id);
@@ -484,7 +484,7 @@ function common_current_user()
             common_ensure_session();
             $id = isset($_SESSION['userid']) ? $_SESSION['userid'] : false;
             if ($id) {
-                $user = User::staticGet($id);
+                $user = User::getKV($id);
                 if ($user) {
                        $_cur = $user;
                        return $_cur;
@@ -675,7 +675,7 @@ function common_find_mentions($text, $notice)
 {
     $mentions = array();
 
-    $sender = Profile::staticGet('id', $notice->profile_id);
+    $sender = Profile::getKV('id', $notice->profile_id);
 
     if (empty($sender)) {
         return $mentions;
@@ -690,14 +690,14 @@ function common_find_mentions($text, $notice)
         // Is it a reply?
 
         if (!empty($notice) && !empty($notice->reply_to)) {
-            $originalNotice = Notice::staticGet('id', $notice->reply_to);
+            $originalNotice = Notice::getKV('id', $notice->reply_to);
             if (!empty($originalNotice)) {
-                $originalAuthor = Profile::staticGet('id', $originalNotice->profile_id);
+                $originalAuthor = Profile::getKV('id', $originalNotice->profile_id);
 
                 $ids = $originalNotice->getReplies();
 
                 foreach ($ids as $id) {
-                    $repliedTo = Profile::staticGet('id', $id);
+                    $repliedTo = Profile::getKV('id', $id);
                     if (!empty($repliedTo)) {
                         $originalMentions[$repliedTo->nickname] = $repliedTo;
                     }
@@ -729,7 +729,7 @@ function common_find_mentions($text, $notice)
             }
 
             if (!empty($mentioned)) {
-                $user = User::staticGet('id', $mentioned->id);
+                $user = User::getKV('id', $mentioned->id);
 
                 if ($user) {
                     $url = common_local_url('userbyid', array('id' => $user->id));
@@ -979,7 +979,7 @@ function common_linkify($url) {
 
     // Check to see whether this is a known "attachment" URL.
 
-    $f = File::staticGet('url', $longurl);
+    $f = File::getKV('url', $longurl);
 
     if (empty($f)) {
         if (common_config('attachments', 'process_links')) {
@@ -993,7 +993,7 @@ function common_linkify($url) {
             $is_attachment = true;
             $attachment_id = $f->id;
 
-            $thumb = File_thumbnail::staticGet('file_id', $f->id);
+            $thumb = File_thumbnail::getKV('file_id', $f->id);
             if (!empty($thumb)) {
                 $has_thumb = true;
             }
@@ -1150,7 +1150,7 @@ function common_valid_profile_tag($str)
  */
 function common_group_link($sender_id, $nickname)
 {
-    $sender = Profile::staticGet($sender_id);
+    $sender = Profile::getKV($sender_id);
     $group = User_group::getForNickname($nickname, $sender);
     if ($sender && $group && $sender->isMember($group)) {
         $attrs = array('href' => $group->permalink(),
@@ -1217,9 +1217,9 @@ function common_relative_profile($sender, $nickname, $dt=null)
         return $recipient;
     }
     // If this is a local user, try to find a local user with that nickname.
-    $sender = User::staticGet($sender->id);
+    $sender = User::getKV($sender->id);
     if ($sender) {
-        $recipient_user = User::staticGet('nickname', $nickname);
+        $recipient_user = User::getKV('nickname', $nickname);
         if ($recipient_user) {
             return $recipient_user->getProfile();
         }
@@ -2020,7 +2020,7 @@ function common_profile_uri($profile)
 
     if (!empty($profile)) {
         if (Event::handle('StartCommonProfileURI', array($profile, &$uri))) {
-            $user = User::staticGet($profile->id);
+            $user = User::getKV($profile->id);
             if (!empty($user)) {
                 $uri = $user->uri;
             }
index aa718d079e6d044ae4907f7cea942f29c803d1ec..ff9536028130836378e46beb3dd56c61e4777c75 100644 (file)
@@ -202,10 +202,10 @@ class ActivityPlugin extends Plugin
     {
         // Only do this if config is enabled
         if(!$this->StopLike) return true;
-        $user = User::staticGet('id', $profile->id);
+        $user = User::getKV('id', $profile->id);
 
         if (!empty($user)) {
-            $author = Profile::staticGet('id', $notice->profile_id);
+            $author = Profile::getKV('id', $notice->profile_id);
             // TRANS: Text for "stopped liking" item in activity plugin.
             // TRANS: %1$s is a profile URL, %2$s is a profile name,
             // TRANS: %3$s is a notice URL, %4$s is an author name.
@@ -370,9 +370,9 @@ class ActivityPlugin extends Plugin
     {
         switch ($notice->verb) {
         case ActivityVerb::FAVORITE:
-            $fave = Fave::staticGet('uri', $notice->uri);
+            $fave = Fave::getKV('uri', $notice->uri);
             if (!empty($fave)) {
-                $notice = Notice::staticGet('id', $fave->notice_id);
+                $notice = Notice::getKV('id', $fave->notice_id);
                 if (!empty($notice)) {
                     $cur = common_current_user();
                     $target = $notice->asActivity($cur);
@@ -390,7 +390,7 @@ class ActivityPlugin extends Plugin
             // FIXME: do something here
             break;
         case ActivityVerb::JOIN:
-            $mem = Group_member::staticGet('uri', $notice->uri);
+            $mem = Group_member::getKV('uri', $notice->uri);
             if (!empty($mem)) {
                 $group = $mem->getGroup();
                 $activity->objects = array(ActivityObject::fromGroup($group));
@@ -400,9 +400,9 @@ class ActivityPlugin extends Plugin
             // FIXME: ????
             break;
         case ActivityVerb::FOLLOW:
-            $sub = Subscription::staticGet('uri', $notice->uri);
+            $sub = Subscription::getKV('uri', $notice->uri);
             if (!empty($sub)) {
-                $profile = Profile::staticGet('id', $sub->subscribed);
+                $profile = Profile::getKV('id', $sub->subscribed);
                 if (!empty($profile)) {
                     $activity->objects = array(ActivityObject::fromProfile($profile));
                 }
index c795225ef861d88e4c287b887994fa587b442d12..6e3dbcf62a6c9c63b5f7fc0c6ba2c61454714c5f 100644 (file)
@@ -51,7 +51,7 @@ class JoinListItem extends SystemListItem
         $notice = $this->nli->notice;
         $out    = $this->nli->out;
 
-        $mem = Group_member::staticGet('uri', $notice->uri);
+        $mem = Group_member::getKV('uri', $notice->uri);
 
         if (!empty($mem)) {
             $out->elementStart('div', 'join-activity');
index 978f8b4cf8cf3c6f59b1a56bdfc189aa0be4182f..975fc6885c0c3be709c90c1b9553c8bc98b2c297 100644 (file)
@@ -151,7 +151,7 @@ class ActivitySpamPlugin extends Plugin
     }
 
     function onNoticeDeleteRelated($notice) {
-        $score = Spam_score::staticGet('notice_id', $notice->id);
+        $score = Spam_score::getKV('notice_id', $notice->id);
         if (!empty($score)) {
             $score->delete();
         }
@@ -185,7 +185,7 @@ class ActivitySpamPlugin extends Plugin
 
             if (!empty($notice)) {
 
-                $score = Spam_score::staticGet('notice_id', $notice->id);
+                $score = Spam_score::getKV('notice_id', $notice->id);
 
                 if (empty($score)) {
                     // If it's empty, we can train it.
@@ -263,7 +263,7 @@ class ActivitySpamPlugin extends Plugin
         if ($this->hideSpam) {
             if ($bResult) {
 
-                $score = Spam_score::staticGet('notice_id', $notice->id);
+                $score = Spam_score::getKV('notice_id', $notice->id);
 
                 if (!empty($score) && $score->is_spam) {
                     if (empty($profile) ||
index dd7209f59446698808b4c6c14a7809a352bc2eeb..2ae32fbfaa4835718ca97b411be479f9ae1978e8 100644 (file)
@@ -74,7 +74,7 @@ class Spam_score extends Managed_DataObject
     function save($notice, $result) {
 
         $orig  = null;
-        $score = Spam_score::staticGet('notice_id', $notice->id);
+        $score = Spam_score::getKV('notice_id', $notice->id);
 
         if (empty($score)) {
             $score = new Spam_score();
@@ -184,7 +184,7 @@ class Spam_score extends Managed_DataObject
         
         if ($score->find()) {
             while ($score->fetch()) {
-                $notice = Notice::staticGet('id', $score->notice_id);
+                $notice = Notice::getKV('id', $score->notice_id);
                 if (!empty($notice)) {
                     $orig = clone($score);
                     $score->notice_created = $notice->created;
index fde299e9825449fd4a77c915b91ed8fccd715f97..3a5e585fd5218c4296678459990c37f3569f3981 100644 (file)
@@ -64,7 +64,7 @@ function silencespammer($filter, $user, $minimum, $percent) {
 
     printfnq("Testing user %s\n", $user->nickname);
 
-    $profile = Profile::staticGet('id', $user->id);
+    $profile = Profile::getKV('id', $user->id);
 
     if ($profile->isSilenced()) {
        printfnq("Already silenced %s\n", $user->nickname);
index 0b776bd42b13c723d4e30e5a197be291dc3179df..0eee9324bf289bedf2992d31370b964e00592fdf 100644 (file)
@@ -64,7 +64,7 @@ function testUser($filter, $user) {
 
     printfnq("Testing user %s\n", $user->nickname);
 
-    $profile = Profile::staticGet('id', $user->id);
+    $profile = Profile::getKV('id', $user->id);
 
     $str = new ProfileNoticeStream($profile, $profile);
 
index f3739ac7b8bae43802f92763d1ffed701490244d..974048b4c911211e63c9975031490344372d1460 100644 (file)
@@ -38,7 +38,7 @@ function trainUser($filter, $user, $category) {
 
     printfnq("Training user %s\n", $user->nickname);
 
-    $profile = Profile::staticGet('id', $user->id);
+    $profile = Profile::getKV('id', $user->id);
 
     $str = new ProfileNoticeStream($profile, $profile);
 
index f5c82361ccb8473a1f3bcc66f3b0b90b3b474398..69124b0dcc1f1772a9317be814f8cd0dc370e3bc 100644 (file)
@@ -79,7 +79,7 @@ class TrainAction extends Action
 
         $id = $this->trimmed('notice');
 
-        $this->notice = Notice::staticGet('id', $id);
+        $this->notice = Notice::getKV('id', $id);
 
         if (empty($this->notice)) {
             throw new ClientException(_("No such notice."));
index af6ea20bd315fb32cb78a3d4ce0f04029236bf54..c3f810d6ee0a4c3f905faeba228adf386c829a93 100644 (file)
@@ -272,7 +272,7 @@ class AnonymousFavePlugin extends Plugin
             $parts = explode('-', $anon);
             $id = $parts[1];
             // Do Profile lookup by ID instead of nickname for safety/performance
-            $profile = Profile::staticGet('id', $id);
+            $profile = Profile::getKV('id', $id);
         } else {
             $profile = AnonymousFavePlugin::createAnonProfile();
             // Obfuscate so it's hard to figure out the Profile ID
@@ -294,7 +294,7 @@ class AnonymousFavePlugin extends Plugin
      */
     function hasAnonFaving($item)
     {
-        $profile = Profile::staticGet('id', $item->notice->profile_id);
+        $profile = Profile::getKV('id', $item->notice->profile_id);
         if (in_array($profile->nickname, $this->restricted)) {
             return false;
         }
index 7a610fb5f5b3c47084844267cfe9791f301fba27..5962e5ad87f474cb1e140bcdc0f3ba464145311b 100644 (file)
@@ -198,7 +198,7 @@ class Fave_tally extends Managed_DataObject
      */
     static function ensureTally($noticeID)
     {
-        $tally = Fave_tally::staticGet('notice_id', $noticeID);
+        $tally = Fave_tally::getKV('notice_id', $noticeID);
 
         if (!$tally) {
             $tally = new Fave_tally();
index 859e4bd427864bec31c6bc7d27088944fdd06c87..e5ae09679dfc2d50f4598ac5a73fd1258fa068ad 100644 (file)
@@ -64,7 +64,7 @@ class AnonDisfavorAction extends RedirectingAction
         }
 
         $id     = $this->trimmed('notice');
-        $notice = Notice::staticGet($id);
+        $notice = Notice::getKV($id);
         $token  = $this->trimmed('token-' . $notice->id);
 
         if (!$token || $token != common_session_token()) {
index f20d55a8631ebb181f90586b3e312f73a6100553..401b6a855b1a07eb0a912d96ff1e3866fe7657bf 100644 (file)
@@ -63,7 +63,7 @@ class AnonFavorAction extends RedirectingAction
         }
 
         $id     = $this->trimmed('notice');
-        $notice = Notice::staticGet($id);
+        $notice = Notice::getKV($id);
         $token  = $this->trimmed('token-' . $notice->id);
 
         if (empty($token) || $token != common_session_token()) {
index 7a077eb2906cb863bbc833d82c39a08bcc02c31e..83885ab799885f39919a1013eec4becf863cccda 100644 (file)
@@ -54,7 +54,7 @@ class AuthCryptPlugin extends AuthenticationPlugin
      */
 
     function checkPassword($username, $password) {
-        $user = User::staticGet('nickname', common_canonical_nickname($username));
+        $user = User::getKV('nickname', common_canonical_nickname($username));
 
         // crypt cuts the second parameter to its appropriate length based on hash scheme
         if (!empty($user) && $user->password === crypt($password, $user->password)) {
@@ -76,7 +76,7 @@ class AuthCryptPlugin extends AuthenticationPlugin
             return false;
         }
 
-        $user = User::staticGet('nickname', $username);
+        $user = User::getKV('nickname', $username);
         if (empty($user)) {
             return false;
         }
index ebdc6132431c3362d807dabbe982d7c798f8297c..e197254f7f0419b5516416a2102f2dbb163a0f26 100644 (file)
@@ -74,7 +74,7 @@ class AutoSandboxPlugin extends Plugin
          $instr = _m('Note you will initially be "sandboxed" so your posts will not appear in the public timeline.');
 
          if (isset($this->contact)) {
-             $contactuser = User::staticGet('nickname', $this->contact);
+             $contactuser = User::getKV('nickname', $this->contact);
              if (!empty($contactuser)) {
                  $contactlink = "@<a href=\"$contactuser->uri\">$contactuser->nickname</a>";
                  // TRANS: User instructions after registration.
index 99a6786de42ebd84789ee0bfcb9812e02afe50be..440084702cece0c19ed9e90737f2d4f41a525808 100644 (file)
@@ -133,7 +133,7 @@ class Homepage_blacklist extends Managed_DataObject
         $toInsert = array_diff($newPatterns, $oldPatterns);
 
         foreach ($toDelete as $pattern) {
-            $nb = Homepage_blacklist::staticGet('pattern', $pattern);
+            $nb = Homepage_blacklist::getKV('pattern', $pattern);
             if (!empty($nb)) {
                 $nb->delete();
             }
@@ -151,7 +151,7 @@ class Homepage_blacklist extends Managed_DataObject
 
     static function ensurePattern($pattern)
     {
-        $hb = Homepage_blacklist::staticGet('pattern', $pattern);
+        $hb = Homepage_blacklist::getKV('pattern', $pattern);
 
         if (empty($nb)) {
             $hb = new Homepage_blacklist();
index bc466f879d87116f138309cfe5c5ff66b6922878..bf1d1e5ab7310b56a1aafdeabaafc4310beb4f64 100644 (file)
@@ -124,7 +124,7 @@ class Nickname_blacklist extends Managed_DataObject
         $toInsert = array_diff($newPatterns, $oldPatterns);
 
         foreach ($toDelete as $pattern) {
-            $nb = Nickname_blacklist::staticGet('pattern', $pattern);
+            $nb = Nickname_blacklist::getKV('pattern', $pattern);
             if (!empty($nb)) {
                 $nb->delete();
             }
@@ -142,7 +142,7 @@ class Nickname_blacklist extends Managed_DataObject
 
     static function ensurePattern($pattern)
     {
-        $nb = Nickname_blacklist::staticGet('pattern', $pattern);
+        $nb = Nickname_blacklist::getKV('pattern', $pattern);
 
         if (empty($nb)) {
             $nb = new Nickname_blacklist();
index 4d1820936ff33f2f7d398f7419707c069002e367..b7de821d923096927c72f36acfe46a47edd51627 100644 (file)
@@ -218,12 +218,12 @@ class Blog_entry extends Managed_DataObject
 
     static function fromNotice($notice)
     {
-        return Blog_entry::staticGet('uri', $notice->uri);
+        return Blog_entry::getKV('uri', $notice->uri);
     }
 
     function getNotice()
     {
-        return Notice::staticGet('uri', $this->uri);
+        return Notice::getKV('uri', $this->uri);
     }
 
     function asActivityObject()
index 288527b42a19e71567175649a664c81b7aea84e0..b46a65e5ffb4c487f60f14baf1cfc1e7771a15aa 100644 (file)
@@ -53,7 +53,7 @@ class ShowblogentryAction extends ShownoticeAction
     {
         $this->id = $this->trimmed('id');
 
-        $this->entry = Blog_entry::staticGet('id', $this->id);
+        $this->entry = Blog_entry::getKV('id', $this->id);
 
         if (empty($this->entry)) {
             // TRANS: Client exception thrown when referring to a non-existing blog entry.
index f9bc71447eee79df3cc7c1539be7eed6b189c55d..f58276433ffacdcd454567de6b4d0232418ef0ae 100644 (file)
@@ -130,7 +130,7 @@ class Bookmark extends Managed_DataObject
      */
     static function getByNotice($notice)
     {
-        return self::staticGet('uri', $notice->uri);
+        return self::getKV('uri', $notice->uri);
     }
 
     /**
@@ -182,7 +182,7 @@ class Bookmark extends Managed_DataObject
         }
 
         if (array_key_exists('uri', $options)) {
-            $other = Bookmark::staticGet('uri', $options['uri']);
+            $other = Bookmark::getKV('uri', $options['uri']);
             if (!empty($other)) {
                 // TRANS: Client exception thrown when trying to save a new bookmark that already exists.
                 throw new ClientException(_m('Bookmark already exists.'));
@@ -270,7 +270,7 @@ class Bookmark extends Managed_DataObject
         // Use user's preferences for short URLs, if possible
 
         try {
-            $user = User::staticGet('id', $profile->id);
+            $user = User::getKV('id', $profile->id);
 
             $shortUrl = File_redirection::makeShort($url,
                                                     empty($user) ? null : $user);
index f644289ed45efdc30908660827c23dd2046a7f73..c8408cf9713318a8faefc2bdc2dfa5e64ca48d84 100644 (file)
@@ -498,7 +498,7 @@ class BookmarkPlugin extends MicroAppPlugin
             if (!empty($other)) {
                 $options['replies'][] = $replyURI;
             } else {
-                $group = User_group::staticGet('uri', $replyURI);
+                $group = User_group::getKV('uri', $replyURI);
                 if (!empty($group)) {
                     $options['groups'][] = $replyURI;
                 }
@@ -509,7 +509,7 @@ class BookmarkPlugin extends MicroAppPlugin
         // @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;
@@ -637,7 +637,7 @@ class BookmarkPlugin extends MicroAppPlugin
     {
         assert($obj->type == ActivityObject::BOOKMARK);
 
-        $bm = Bookmark::staticGet('uri', $obj->id);
+        $bm = Bookmark::getKV('uri', $obj->id);
 
         if (empty($bm)) {
             throw new ServerException("Unknown bookmark: " . $obj->id);
index e4dedf4a48c7c38abb69c22f3a0c7593dd466aad..4e6de9bffac6dad6128e41cbafcf6f46b36c89f1 100644 (file)
@@ -78,7 +78,7 @@ class BookmarkforurlAction extends Action
             throw new ClientException(_('Invalid URL.'), 400);
         }
 
-        $f = File::staticGet('url', $this->url);
+        $f = File::getKV('url', $this->url);
 
         if (empty($url)) { 
            $f = File::processNew($this->url);
@@ -87,11 +87,11 @@ class BookmarkforurlAction extends Action
         // How about now?
 
         if (!empty($f)) {
-            $this->oembed    = File_oembed::staticGet('file_id', $f->id);
+            $this->oembed    = File_oembed::getKV('file_id', $f->id);
             if (!empty($this->oembed)) {
                 $this->title = $this->oembed->title;
             }
-            $this->thumbnail = File_thumbnail::staticGet('file_id', $f->id);
+            $this->thumbnail = File_thumbnail::getKV('file_id', $f->id);
         }
 
         return true;
index a2dbf8156dafdef83afef57295e23f18edd4e84e..f9613fbd6e2806b6d8a2e513320f661e90cfd6fe 100644 (file)
@@ -105,7 +105,7 @@ class BookmarkListItem extends NoticeListItemAdapter
             $out->elementStart('ul', array('class' => 'bookmark-tags'));
 
             foreach ($replies as $reply) {
-                $other = Profile::staticGet('id', $reply);
+                $other = Profile::getKV('id', $reply);
                 if (!empty($other)) {
                     $out->elementStart('li');
                     $out->element('a', array('rel' => 'tag',
index 6faf99929c1d2ee05562107ede770d217015dbd6..8c786d6fb096659a941332e00dee8942db8a5144 100644 (file)
@@ -77,7 +77,7 @@ class BookmarksAction extends Action
             $nickname = $nickname[1]['nickname'];
         }
         
-        $this->user = User::staticGet('nickname', $nickname);
+        $this->user = User::getKV('nickname', $nickname);
 
         if (!$this->user) {
             // TRANS: Client error displayed when trying to display bookmarks for a non-existing user.
index 63534cac79eb80a8adf5c69be0bde0890220ef00..a52a0b7f433aa6b091501a8f80f3f8bb8da61bbc 100644 (file)
@@ -67,7 +67,7 @@ class BookmarksrssAction 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 bookmarks of a user that does not exist.
index 4065fc308593ebc1d55330788d43799fd62e0350..eca9e96060549d8d807cfdf121cb284c4c68d654 100644 (file)
@@ -65,7 +65,7 @@ class DeliciousBookmarkImporter extends QueueHandler
      */
     function handle($data)
     {
-        $profile = Profile::staticGet('id', $data['profile_id']);
+        $profile = Profile::getKV('id', $data['profile_id']);
 
         try {
             $saved = Bookmark::saveNew($profile,
index 0f40db8fccc78fa63c941041baf34c0b0f37a843..d5f9940805ef74b1689add1540b121de163044a7 100644 (file)
@@ -62,7 +62,7 @@ class NoticebyurlAction extends Action
     {
         parent::prepare($argarray);
 
-        $this->file = File::staticGet('id', $this->trimmed('id'));
+        $this->file = File::getKV('id', $this->trimmed('id'));
 
         if (empty($this->file)) {
             // TRANS: Client exception thrown when an unknown URL is provided.
index 9220afffff0bb9fea1f41fef21b824ffe04aab53..1c562d52a8503e28e3f00aee9aec05ea4e455375 100644 (file)
@@ -52,14 +52,14 @@ class ShowbookmarkAction extends ShownoticeAction
     {
         $this->id = $this->trimmed('id');
 
-        $this->bookmark = Bookmark::staticGet('id', $this->id);
+        $this->bookmark = Bookmark::getKV('id', $this->id);
 
         if (empty($this->bookmark)) {
             // TRANS: Client exception thrown when referring to a non-existing bookmark.
             throw new ClientException(_m('No such bookmark.'), 404);
         }
 
-        $notice = Notice::staticGet('uri', $this->bookmark->uri);
+        $notice = Notice::getKV('uri', $this->bookmark->uri);
 
         if (empty($notice)) {
             // Did we used to have it, and it got deleted?
index ad9435b7f945606c3cf37fbd2620a7b1cb28edfe..d6e29264d905a60da0ee3a88624ae75fa39715c3 100644 (file)
@@ -104,7 +104,7 @@ class DisqusPlugin extends Plugin
     {
         if (get_class($action) == 'ShownoticeAction') {
 
-            $profile = Profile::staticGet('id', $action->notice->profile_id);
+            $profile = Profile::getKV('id', $action->notice->profile_id);
 
             if ($this->isAllowedRichEdit($profile)) {
 
@@ -192,7 +192,7 @@ ENDOFSCRIPT;
             return;
         }
 
-        $profile = Profile::staticGet('id', $noticeListItem->notice->profile_id);
+        $profile = Profile::getKV('id', $noticeListItem->notice->profile_id);
 
         if ($this->isAllowedRichEdit($profile)) {
             $noticeUrl = $noticeListItem->notice->bestUrl();
@@ -221,7 +221,7 @@ ENDOFSCRIPT;
     private function isAllowedRichEdit($profile)
     {
         if ($this->restricted) {
-            $user = User::staticGet($profile->id);
+            $user = User::getKV($profile->id);
             return !empty($user) && $user->hasRole('richedit');
         } else {
             return true;
index 10208cfbe7376d4263fc6df5de8ea0e2ecaa5eaa..3364c8ae5c2b5ecab5213038ea2db588f51389f0 100644 (file)
@@ -74,7 +74,7 @@ class DomainStatusNetworkPlugin extends Plugin
         }
 
         try {
-            $sn = Status_network::staticGet('nickname', $nickname);
+            $sn = Status_network::getKV('nickname', $nickname);
         } catch (Exception $e) {
             $this->log(LOG_ERR, $e->getMessage());
             return;
@@ -134,11 +134,11 @@ class DomainStatusNetworkPlugin extends Plugin
 
     static function nicknameAvailable($nickname)
     {
-        $sn = Status_network::staticGet('nickname', $nickname);
+        $sn = Status_network::getKV('nickname', $nickname);
         if (!empty($sn)) {
             return false;
         }
-        $usn = Unavailable_status_network::staticGet('nickname', $nickname);
+        $usn = Unavailable_status_network::getKV('nickname', $nickname);
         if (!empty($usn)) {
             return false;
         }
@@ -203,7 +203,7 @@ class DomainStatusNetworkPlugin extends Plugin
         $snt = Status_network_tag::withTag('domain='.$domain);
 
         while ($snt->fetch()) {
-            $sn = Status_network::staticGet('site_id', $snt->site_id);
+            $sn = Status_network::getKV('site_id', $snt->site_id);
             if (!empty($sn)) {
                 return $sn;
             }
@@ -235,7 +235,7 @@ class DomainStatusNetworkPlugin extends Plugin
 
         StatusNet::switchSite($sn->nickname);
 
-        $user = User::staticGet('email', $email);
+        $user = User::getKV('email', $email);
 
         return !empty($user);
     }
@@ -317,7 +317,7 @@ class DomainStatusNetworkPlugin extends Plugin
 
         StatusNet::switchSite($sn->nickname);
 
-        $user = User::staticGet('email', $email);
+        $user = User::getKV('email', $email);
         
         if (empty($user)) {
             throw new ClientException(_('No such user.'));
index dd93a51153b615c6558438c9f5a59fe11e34265d..ad57e134d1015582bc8b54508b07fd908753cda1 100644 (file)
@@ -188,7 +188,7 @@ class DomainStatusNetworkInstaller extends Installer
 
         // Re-fetch; stupid auto-increment integer isn't working
 
-        $sn = Status_network::staticGet('nickname', $sn->nickname);
+        $sn = Status_network::getKV('nickname', $sn->nickname);
 
         if (empty($sn)) {
             throw new ServerException("Created {$this->nickname} status_network and could not find it again.");
index e55614ea432d820faadbec3f26569af9daa51ab6..ba131945c167150a64ee2463e4af4f3991de2983 100644 (file)
@@ -38,7 +38,7 @@ class EmailAuthenticationPlugin extends Plugin
     {
         if(strpos($nickname, '@'))
         {
-            $user = User::staticGet('email',$nickname);
+            $user = User::getKV('email',$nickname);
             if($user && isset($user->email))
             {
                 if(common_check_user($user->nickname,$password))
index 8759614129b8f1feb8ed1926e4ea4733475bcc38..2f1116ba0cdaad4a4e8b89a6edc9e4a9de12d6cf 100644 (file)
@@ -102,7 +102,7 @@ class EmailRegistrationPlugin extends Plugin
 
     static function registerEmail($email)
     {
-        $old = User::staticGet('email', $email);
+        $old = User::getKV('email', $email);
 
         if (!empty($old)) {
             // TRANS: Error text when trying to register with an already registered e-mail address.
@@ -147,7 +147,7 @@ class EmailRegistrationPlugin extends Plugin
 
         $n = 0;
 
-        while (User::staticGet('nickname', $nickname)) {
+        while (User::getKV('nickname', $nickname)) {
             $n++;
             $nickname = $original . $n;
         }
index e5c7d8a56c37e89a5f3621c614a82d9cb30458db..5eaf84ad5402859ea3916a8b311459991bee9993 100644 (file)
@@ -107,7 +107,7 @@ class EmailregisterAction extends Action
                     throw new ClientException(_m('No confirmation code.'));
                 }
 
-                $this->invitation = Invitation::staticGet('code', $this->code);
+                $this->invitation = Invitation::getKV('code', $this->code);
 
                 if (!empty($this->invitation)) {
                     if (!empty($this->invitation->registered_user_id)) {
@@ -116,7 +116,7 @@ class EmailregisterAction extends Action
                     }
                 } else {
 
-                    $this->confirmation = Confirm_address::staticGet('code', $this->code);
+                    $this->confirmation = Confirm_address::getKV('code', $this->code);
 
                     if (empty($this->confirmation)) {
                         // TRANS: Client exception thrown when given confirmation code was not issued.
@@ -139,7 +139,7 @@ class EmailregisterAction extends Action
                 }
                 $this->state = self::NEWREGISTER;
             } else {
-                $this->invitation = Invitation::staticGet('code', $this->code);
+                $this->invitation = Invitation::getKV('code', $this->code);
                 if (!empty($this->invitation)) {
                     if (!empty($this->invitation->registered_user_id)) {
                         // TRANS: Client exception trown when using an invitation multiple times.
@@ -148,7 +148,7 @@ class EmailregisterAction extends Action
                     $this->state = self::CONFIRMINVITE;
                 } else {
                     $this->state = self::CONFIRMREGISTER;
-                    $this->confirmation = Confirm_address::staticGet('code', $this->code);
+                    $this->confirmation = Confirm_address::getKV('code', $this->code);
 
                     if (empty($this->confirmation)) {
                         // TRANS: Client exception thrown when given confirmation code was not issued.
index 72583f53492a574e51b308cb06df980304cf07ca..4e144af5217f66b8745e8de3ab015a632659ab49 100644 (file)
@@ -168,7 +168,7 @@ class EmailReminderPlugin extends Plugin
         $inviterurl = null;
 
         if ($type == UserInviteReminderHandler::INVITE_REMINDER) {
-            $user = User::staticGet($object->user_id);
+            $user = User::getKV($object->user_id);
             if (!empty($user)) {
                 $profile    = $user->getProfile();
                 $inviter    = $profile->getBestName();
index 36aec6c96c8f2582801d081fef5239a3282885b3..15cc0b5bd83191986d0e99bac89d642017c330c9 100644 (file)
@@ -165,7 +165,7 @@ class EmailSummaryPlugin extends Plugin
 
         if (!empty($user)) {
 
-            $ess = Email_summary_status::staticGet('user_id', $user->id);
+            $ess = Email_summary_status::getKV('user_id', $user->id);
 
             if (empty($ess)) {
 
index 97acd6ca66a082a753e9f370070054947e9da7a0..de9e491fa6aea2c544e6289eb8bbfcf6d4f059fe 100644 (file)
@@ -118,7 +118,7 @@ class Email_summary_status extends Managed_DataObject
      */
     static function getSendSummary($user_id)
     {
-        $ess = Email_summary_status::staticGet('user_id', $user_id);
+        $ess = Email_summary_status::getKV('user_id', $user_id);
 
         if (!empty($ess)) {
             return $ess->send_summary;
@@ -136,7 +136,7 @@ class Email_summary_status extends Managed_DataObject
      */
     static function getLastSummaryID($user_id)
     {
-        $ess = Email_summary_status::staticGet('user_id', $user_id);
+        $ess = Email_summary_status::getKV('user_id', $user_id);
 
         if (!empty($ess)) {
             return $ess->last_summary_id;
index 61542e4f3b851f78802c02871dad145b780d0e29..46275c39c49b656760fb71eb1b828ab0f5fdf764 100644 (file)
@@ -70,7 +70,7 @@ class UserEmailSummaryHandler extends QueueHandler
     {
         // Skip if they've asked not to get summaries
 
-        $ess = Email_summary_status::staticGet('user_id', $user_id);
+        $ess = Email_summary_status::getKV('user_id', $user_id);
 
         if (!empty($ess) && !$ess->send_summary) {
             common_log(LOG_INFO, sprintf('Not sending email summary for user %s by request.', $user_id));
@@ -83,7 +83,7 @@ class UserEmailSummaryHandler extends QueueHandler
             $since_id = $ess->last_summary_id;
         }
 
-        $user = User::staticGet('id', $user_id);
+        $user = User::getKV('id', $user_id);
 
         if (empty($user)) {
             common_log(LOG_INFO, sprintf('Not sending email summary for user %s; no such user.', $user_id));
@@ -145,7 +145,7 @@ class UserEmailSummaryHandler extends QueueHandler
                                           'style' => 'border: none; border-collapse: collapse;', 'cellpadding' => '6'));
 
         while ($notice->fetch()) {
-            $profile = Profile::staticGet('id', $notice->profile_id);
+            $profile = Profile::getKV('id', $notice->profile_id);
 
             if (empty($profile)) {
                 continue;
@@ -185,7 +185,7 @@ class UserEmailSummaryHandler extends QueueHandler
                           common_date_string($notice->created));
             $out->elementEnd('a');
             if ($notice->hasConversation()) {
-                $conv = Conversation::staticGet('id', $notice->conversation);
+                $conv = Conversation::getKV('id', $notice->conversation);
                 $convurl = $conv->uri;
                 if (!empty($convurl)) {
                     $out->text(' ');
index 284f29477c9782bce22117653f2341ad37ec15c5..c0332b91a2f6f8cb38e452a42ff6b84a596719d7 100644 (file)
@@ -35,7 +35,7 @@ class EnjitQueueHandler extends QueueHandler
     function handle($notice)
     {
 
-        $profile = Profile::staticGet($notice->profile_id);
+        $profile = Profile::getKV($notice->profile_id);
 
         $this->log(LOG_INFO, "Posting Notice ".$notice->id." from ".$profile->nickname);
 
index f2396b80751ee7509f32303579355cda7698786e..7676a25ac01a2a29d0abfe33d7e6318eb918a39e 100644 (file)
@@ -197,7 +197,7 @@ class EventPlugin extends MicroappPlugin
         case RSVP::POSITIVE:
         case RSVP::NEGATIVE:
         case RSVP::POSSIBLE:
-            $happening = Happening::staticGet('uri', $happeningObj->id);
+            $happening = Happening::getKV('uri', $happeningObj->id);
             if (empty($happening)) {
                 // FIXME: save the event
                 // TRANS: Exception thrown when trying to RSVP for an unknown event.
index 52aa206435e23f484442ff862c6bb98e0d7863c4..2b097e9077d6470164227406bf731fe5c8b427d2 100644 (file)
@@ -105,7 +105,7 @@ class Happening extends Managed_DataObject
     static function saveNew($profile, $start_time, $end_time, $title, $location, $description, $url, $options=array())
     {
         if (array_key_exists('uri', $options)) {
-            $other = Happening::staticGet('uri', $options['uri']);
+            $other = Happening::getKV('uri', $options['uri']);
             if (!empty($other)) {
                 // TRANS: Client exception thrown when trying to create an event that already exists.
                 throw new ClientException(_m('Event already exists.'));
@@ -189,12 +189,12 @@ class Happening extends Managed_DataObject
 
     function getNotice()
     {
-        return Notice::staticGet('uri', $this->uri);
+        return Notice::getKV('uri', $this->uri);
     }
 
     static function fromNotice($notice)
     {
-        return Happening::staticGet('uri', $notice->uri);
+        return Happening::getKV('uri', $notice->uri);
     }
 
     function getRSVPs()
index 32206613544ebb1687f20970ea6baa49f726d5b2..0a91106e68be89862fe673f2fab6cf580ef9faf0 100644 (file)
@@ -123,7 +123,7 @@ class RSVP extends Managed_DataObject
     function saveNew($profile, $event, $verb, $options=array())
     {
         if (array_key_exists('uri', $options)) {
-            $other = RSVP::staticGet('uri', $options['uri']);
+            $other = RSVP::getKV('uri', $options['uri']);
             if (!empty($other)) {
                 // TRANS: Client exception thrown when trying to save an already existing RSVP ("please respond").
                 throw new ClientException(_m('RSVP already exists.'));
@@ -228,7 +228,7 @@ class RSVP extends Managed_DataObject
 
     function getNotice()
     {
-        $notice = Notice::staticGet('uri', $this->uri);
+        $notice = Notice::getKV('uri', $this->uri);
         if (empty($notice)) {
             // TRANS: Server exception thrown when requesting a non-exsting notice for an RSVP ("please respond").
             // TRANS: %s is the RSVP with the missing notice.
@@ -239,7 +239,7 @@ class RSVP extends Managed_DataObject
 
     static function fromNotice($notice)
     {
-        return RSVP::staticGet('uri', $notice->uri);
+        return RSVP::getKV('uri', $notice->uri);
     }
 
     static function forEvent($event)
@@ -273,7 +273,7 @@ class RSVP extends Managed_DataObject
                        RSVP::POSSIBLE => array());
 
         foreach ($ids as $id) {
-            $rsvp = RSVP::staticGet('id', $id);
+            $rsvp = RSVP::getKV('id', $id);
             if (!empty($rsvp)) {
                 $verb = self::verbFor($rsvp->response);
                 $rsvps[$verb][] = $rsvp;
@@ -285,7 +285,7 @@ class RSVP extends Managed_DataObject
 
     function getProfile()
     {
-        $profile = Profile::staticGet('id', $this->profile_id);
+        $profile = Profile::getKV('id', $this->profile_id);
         if (empty($profile)) {
             // TRANS: Exception thrown when requesting a non-existing profile.
             // TRANS: %s is the ID of the non-existing profile.
@@ -296,7 +296,7 @@ class RSVP extends Managed_DataObject
 
     function getEvent()
     {
-        $event = Happening::staticGet('id', $this->event_id);
+        $event = Happening::getKV('id', $this->event_id);
         if (empty($event)) {
             // TRANS: Exception thrown when requesting a non-existing event.
             // TRANS: %s is the ID of the non-existing event.
@@ -307,7 +307,7 @@ class RSVP extends Managed_DataObject
 
     function asHTML()
     {
-        $event = Happening::staticGet('id', $this->event_id);
+        $event = Happening::getKV('id', $this->event_id);
 
         return self::toHTML($this->getProfile(),
                             $event,
@@ -316,7 +316,7 @@ class RSVP extends Managed_DataObject
 
     function asString()
     {
-        $event = Happening::staticGet('id', $this->event_id);
+        $event = Happening::getKV('id', $this->event_id);
 
         return self::toString($this->getProfile(),
                               $event,
index 6b0ddb228733b7e885008f56dc9f151a0400249c..ab6cc5037e5d91943ce713f79be42ee52dc72456 100644 (file)
@@ -82,14 +82,14 @@ class CancelrsvpAction extends Action
             throw new ClientException(_m('No such RSVP.'));
         }
 
-        $this->rsvp = RSVP::staticGet('id', $rsvpId);
+        $this->rsvp = RSVP::getKV('id', $rsvpId);
 
         if (empty($this->rsvp)) {
             // TRANS: Client exception thrown when referring to a non-existing RSVP ("please respond") item.
             throw new ClientException(_m('No such RSVP.'));
         }
 
-        $this->event = Happening::staticGet('id', $this->rsvp->event_id);
+        $this->event = Happening::getKV('id', $this->rsvp->event_id);
 
         if (empty($this->event)) {
             // TRANS: Client exception thrown when referring to a non-existing event.
index 8052b972a4b365eca3dc22d7c69e52d80edbeddd..272c6f0d9f624b5fed798f22bafa047d2a16e491 100644 (file)
@@ -82,7 +82,7 @@ class NewrsvpAction extends Action
             throw new ClientException(_m('No such event.'));
         }
 
-        $this->event = Happening::staticGet('id', $eventId);
+        $this->event = Happening::getKV('id', $eventId);
 
         if (empty($this->event)) {
             // TRANS: Client exception thrown when referring to a non-existing event.
index 52e17f860aeba8193687fd55d5303519d8011266..f1d8c6a0ddcc8bf9762b53cb5f60d10cfdc5c050 100644 (file)
@@ -53,7 +53,7 @@ class ShoweventAction extends ShownoticeAction
     {
         $this->id = $this->trimmed('id');
 
-        $this->event = Happening::staticGet('id', $this->id);
+        $this->event = Happening::getKV('id', $this->id);
 
         if (empty($this->event)) {
             // TRANS: Client exception thrown when referring to a non-existing event.
index da80448af83d6b035e11d57e5f2473bb3e393cd2..697bda9610e3ea808cd201058c1580d7121f7e5a 100644 (file)
@@ -53,7 +53,7 @@ class ShowrsvpAction extends ShownoticeAction
     {
         $this->id = $this->trimmed('id');
 
-        $this->rsvp = RSVP::staticGet('id', $this->id);
+        $this->rsvp = RSVP::getKV('id', $this->id);
 
         if (empty($this->rsvp)) {
             // TRANS: Client exception thrown when referring to a non-existing RSVP.
index 7b2e53c62ad23009dc5a07224a3b882723edd425..8436275b78f231d2b962b75d59b8e12f46f3e814 100644 (file)
@@ -116,7 +116,7 @@ class ExtendedProfilePlugin extends Plugin
     }
 
     function onEndShowAccountProfileBlock(HTMLOutputter $out, Profile $profile) {
-        $user = User::staticGet('id', $profile->id);
+        $user = User::getKV('id', $profile->id);
         if ($user) {
             $url = common_local_url('profiledetail', array('nickname' => $user->nickname));
             // TRANS: Link text on user profile page leading to extended profile page.
index 2703ab85542a08fd8cf222ebedfd403e0cd776bc..2abbf9c905bbc313437312c7a1fb1472f614c32a 100644 (file)
@@ -345,7 +345,7 @@ class FacebookfinishloginAction extends Action
                 return;
             }
 
-            $invite = Invitation::staticGet($code);
+            $invite = Invitation::getKV($code);
 
             if (empty($invite)) {
                 // TRANS: Client error trying to register with an invalid invitation code.
@@ -367,7 +367,7 @@ class FacebookfinishloginAction extends Action
             return;
         }
 
-        if (User::staticGet('nickname', $nickname)) {
+        if (User::getKV('nickname', $nickname)) {
             // TRANS: Form validation error displayed when picking a nickname that is already in use.
             $this->showForm(_m('Nickname already in use. Try another one.'));
             return;
@@ -503,7 +503,7 @@ class FacebookfinishloginAction extends Action
             return;
         }
 
-        $user = User::staticGet('nickname', $nickname);
+        $user = User::getKV('nickname', $nickname);
 
         $this->tryLinkUser($user);
 
@@ -648,7 +648,7 @@ class FacebookfinishloginAction extends Action
             return false;
         }
 
-        if (User::staticGet('nickname', $str)) {
+        if (User::getKV('nickname', $str)) {
             return false;
         }
 
@@ -666,7 +666,7 @@ class FacebookfinishloginAction extends Action
      function isNewEmail($email)
      {
          // we shouldn't have to validate the format
-         $result = User::staticGet('email', $email);
+         $result = User::getKV('email', $email);
 
          if (empty($result)) {
              return true;
index fe0a90c84835a9f8cd129fcbb7485923ba823b90..a7cf5a13aa20cac519fe61fd462c6b0d565c9752 100644 (file)
@@ -137,13 +137,13 @@ class Notice_to_item extends Managed_DataObject
      */
     static function saveNew($notice_id, $item_id)
     {
-        $n2i = Notice_to_item::staticGet('notice_id', $notice_id);
+        $n2i = Notice_to_item::getKV('notice_id', $notice_id);
 
         if (!empty($n2i)) {
             return $n2i;
         }
 
-        $n2i = Notice_to_item::staticGet('item_id', $item_id);
+        $n2i = Notice_to_item::getKV('item_id', $item_id);
 
         if (!empty($n2i)) {
             return $n2i;
index 26e21cbd6e1daf8642755938e9866ede7e87e6bd..be63051179b007929d0d1d295fcb0307c0f9d628 100644 (file)
@@ -897,7 +897,7 @@ class Facebookclient
      */
     static function facebookStatusId($notice)
     {
-        $n2i = Notice_to_item::staticGet('notice_id', $notice->id);
+        $n2i = Notice_to_item::getKV('notice_id', $notice->id);
 
         if (empty($n2i)) {
             return null;
@@ -979,7 +979,7 @@ class Facebookclient
      */
     function streamRemove()
     {
-        $n2i = Notice_to_item::staticGet('notice_id', $this->notice->id);
+        $n2i = Notice_to_item::getKV('notice_id', $this->notice->id);
 
         if (!empty($this->flink) && !empty($n2i)) {
             try {
@@ -1034,7 +1034,7 @@ class Facebookclient
      */
     function like()
     {
-        $n2i = Notice_to_item::staticGet('notice_id', $this->notice->id);
+        $n2i = Notice_to_item::getKV('notice_id', $this->notice->id);
 
         if (!empty($this->flink) && !empty($n2i)) {
             try {
@@ -1085,7 +1085,7 @@ class Facebookclient
      */
     function unLike()
     {
-        $n2i = Notice_to_item::staticGet('notice_id', $this->notice->id);
+        $n2i = Notice_to_item::getKV('notice_id', $this->notice->id);
 
         if (!empty($this->flink) && !empty($n2i)) {
             try {
index e347d492d10eca3b9d775c15739f25b19e5ec40d..79e3bfa1300bc89f64296f6e54b6c1b4c7ee4cbf 100644 (file)
@@ -120,7 +120,7 @@ class User_followeveryone_prefs extends Managed_DataObject
 
     static function followEveryone($user_id)
     {
-        $ufep = self::staticGet('user_id', $user_id);
+        $ufep = self::getKV('user_id', $user_id);
 
         if (empty($ufep)) {
             return true;
@@ -131,7 +131,7 @@ class User_followeveryone_prefs extends Managed_DataObject
 
     static function savePref($user_id, $followEveryone)
     {
-        $ufep = self::staticGet('user_id', $user_id);
+        $ufep = self::getKV('user_id', $user_id);
 
         if (empty($ufep)) {
             $ufep = new User_followeveryone_prefs();
index 97b78634d73dd1ddd00c3c5caeb879d2c110febc..be354928fbc6a61e8ff5139200dec6435441b16d 100644 (file)
@@ -48,12 +48,12 @@ class Photo extends Managed_DataObject
 
     public static function getByNotice($notice)
     {
-        return self::staticGet('uri', $notice->uri);
+        return self::getKV('uri', $notice->uri);
     }
 
     public function getNotice()
     {
-        return Notice::staticGet('uri', $this->uri);
+        return Notice::getKV('uri', $this->uri);
     }
 
     public static function schemaDef()
index 499d376fcce5f5e26beabf61f11bd09206fc0ede..f187a22a775b8619b93242c8d92e39b2e5ee53ca 100644 (file)
@@ -114,7 +114,7 @@ class GNUsocialPhotosPlugin extends Plugin
     function onEndNoticeAsActivity($notice, &$activity)
     {
         common_log(LOG_INFO, 'photo plugin: EndNoticeAsActivity');
-        $photo = GNUsocialPhoto::staticGet('notice_id', $notice->id);
+        $photo = GNUsocialPhoto::getKV('notice_id', $notice->id);
         if(!$photo) {
             common_log(LOG_INFO, 'not a photo.');
             return true;
@@ -166,7 +166,7 @@ class GNUsocialPhotosPlugin extends Plugin
 
     function onStartShowNoticeItem($action)
     {
-        $photo = GNUsocialPhoto::staticGet('notice_id', $action->notice->id);
+        $photo = GNUsocialPhoto::getKV('notice_id', $action->notice->id);
         if($photo) { 
             $action->out->elementStart('div', 'entry-title');
             $action->showAuthor();
index 34f41a275257840cfdf67c2b825b4619e7881749..7ac8104ae8be87fdbbcec6da290ea48021068b97 100644 (file)
@@ -42,7 +42,7 @@ class EditphotoAction extends Action
         $args = $this->returnToArgs();
         $this->user = common_current_user();
         $this->photoid = $args[1]['photoid'];
-        $this->photo = GNUsocialPhoto::staticGet('id', $this->photoid);
+        $this->photo = GNUsocialPhoto::getKV('id', $this->photoid);
         return true;
     }
 
@@ -166,7 +166,7 @@ class EditphotoAction extends Action
 
         $profile_id = $cur->id;
        
-        $album = GNUsocialPhotoAlbum::staticGet('album_id', $this->trimmed('album'));
+        $album = GNUsocialPhotoAlbum::getKV('album_id', $this->trimmed('album'));
         if ($album->profile_id != $profile_id) {
             $this->showForm(_('Error: This is not your album!'));
             return;
@@ -188,7 +188,7 @@ class EditphotoAction extends Action
         //For redirection
         $oldalbum = $this->album_id;
 
-        $notice = Notice::staticGet('id', $this->photo->notice_id);
+        $notice = Notice::getKV('id', $this->photo->notice_id);
 
         $this->photo->delete();
         
index 4d08e5bbd6393ed15870285397c72ce394a7075c..e94073914fabc7c9ac976d0327c5db19b08207ba 100644 (file)
@@ -45,10 +45,10 @@ class PhotoAction extends Action
 
         $args = $this->returnToArgs();
         $this->photoid = $args[1]['photoid'];
-        $this->photo = GNUsocialPhoto::staticGet('id', $this->photoid);
-        $this->notice = Notice::staticGet('id', $this->photo->notice_id);
+        $this->photo = GNUsocialPhoto::getKV('id', $this->photoid);
+        $this->notice = Notice::getKV('id', $this->photo->notice_id);
 
-        $this->user = Profile::staticGet('id', $this->notice->profile_id);
+        $this->user = Profile::getKV('id', $this->notice->profile_id);
         
         $notices = Notice::conversationStream((int)$this->notice->conversation, null, null); 
         $this->conversation = new ConversationTree($notices, $this);
index 3b8a0fd64f29e55093f13fd0e4102cca8f15107d..c966d0b71d7cf6eca8e89069cbc9d5074af85242 100644 (file)
@@ -48,7 +48,7 @@ class PhotosAction extends Action
         if (common_valid_profile_tag($username) == 0) {
             $this->user = null;
         } else {
-            $this->user = Profile::staticGet('nickname', $username);
+            $this->user = Profile::getKV('nickname', $username);
         }
         return true;
     }
@@ -120,7 +120,7 @@ class PhotosAction extends Action
     
     function showAlbum($album_id)
     {
-        $album = GNUSocialPhotoAlbum::staticGet('album_id', $album_id);
+        $album = GNUSocialPhotoAlbum::getKV('album_id', $album_id);
         if (!$album) {
             return;
         }
index 5411ec8089ce5b8a5d448421fc8b1dc39b1432b9..25bd4f84d0e585ed0282968066698c7fc99fda35 100644 (file)
@@ -214,7 +214,7 @@ class PhotouploadAction extends Action
         $thumb_uri = 'http://' . common_config('site', 'server') . '/file/thumb.' . $filename;
         $profile_id = $cur->id;
        
-        $album = GNUsocialPhotoAlbum::staticGet('album_id', $this->trimmed('album'));
+        $album = GNUsocialPhotoAlbum::getKV('album_id', $this->trimmed('album'));
         if ($album->profile_id != $profile_id) {
             $this->showForm(_('Error: This is not your album!'));
             return;
@@ -241,13 +241,13 @@ class PhotouploadAction extends Action
         if(empty($cur)) return;
         
         $album_id = $this->trimmed('album');
-        $album = GNUsocialPhotoAlbum::staticGet('album_id', $album_id);
+        $album = GNUsocialPhotoAlbum::getKV('album_id', $album_id);
         if (empty($album)) {
             $this->showForm(_('This album does not exist or has been deleted.'));
             return;
         }
         //Check if the album has any photos in it before deleting
-        $photos = GNUsocialPhoto::staticGet('album_id', $album_id);
+        $photos = GNUsocialPhoto::getKV('album_id', $album_id);
         if(empty($photos)) {
             $album->delete();
             $this->showForm(_('Album deleted'), true);
index 14e673beb71b7033bc744a8e361dc79b3085cc56..722a8f69ae11efc0c283a3a9feaa6eaf0be4d82b 100644 (file)
@@ -69,13 +69,13 @@ class GNUsocialPhotoAlbum extends Managed_DataObject
 
     function getPageLink()
     {
-        $profile = Profile::StaticGet('id', $this->profile_id);
+        $profile = Profile::getKV('id', $this->profile_id);
         return '/' . $profile->nickname . '/photos/' . $this->album_id;
     }
 
     function getThumbUri()
     {
-        $photo = GNUsocialPhoto::staticGet('album_id', $this->album_id);
+        $photo = GNUsocialPhoto::getKV('album_id', $this->album_id);
         if (empty($photo))
             return '/theme/default/default-avatar-profile.png'; //For now...
         return $photo->thumb_uri;
@@ -84,7 +84,7 @@ class GNUsocialPhotoAlbum extends Managed_DataObject
     static function newAlbum($profile_id, $album_name, $album_description)
     {
         //TODO: Should use foreign key instead...
-        if (!Profile::staticGet('id', $profile_id)){
+        if (!Profile::getKV('id', $profile_id)){
             //Is this a bit extreme?
             throw new ServerException(_m('No such user exists with id ' . $profile_id . ', couldn\'t create album.'));
         }
index bc9f12cb132ee68250eaeee8aa24c790ce8ec00f..32460de426cccfb58a466b01008c9632b3489ec9 100644 (file)
@@ -43,7 +43,7 @@ class BioAction extends Action
         parent::prepare($args);
 
         $args = $this->returnToArgs();
-        $this->profile = Profile::staticGet('nickname', $args[1]['nickname']);
+        $this->profile = Profile::getKV('nickname', $args[1]['nickname']);
         //die(print_r($this->profile));
         gnusocial_profile_merge($this->profile);
         $this->avatar = $this->profile->getAvatar(96);
index d8c4e3dd321b8efa1b638fb7379f6fa09b27857b..0076af1bd658d3150d9175c00f75019772eb0015 100644 (file)
@@ -54,7 +54,7 @@ class ProfilefieldsAdminPanelAction extends AdminPanelAction
 
     function saveSettings()
     {
-        $field = GNUsocialProfileExtensionField::staticGet('id', $this->trimmed('id'));
+        $field = GNUsocialProfileExtensionField::getKV('id', $this->trimmed('id'));
         if (!$field)
             $field = new GNUsocialProfileExtensionField();
         $field->title = $this->trimmed('title');
@@ -110,7 +110,7 @@ class ProfilefieldsAdminForm extends AdminForm
         $fieldsettitle = _("New Profile Field");
         //Edit a field
         if ($this->out->trimmed('edit')) { 
-            $field = GNUsocialProfileExtensionField::staticGet('id', $this->out->trimmed('edit'));
+            $field = GNUsocialProfileExtensionField::getKV('id', $this->out->trimmed('edit'));
             $title = $field->title;
             $description = $field->description;
             $type = $field->type;
index 543fe9129f522c21b136ed9d62365903b200c5f8..0311ee596ce9fcdd86fe0735445bfb38aa2ed9e9 100644 (file)
@@ -45,12 +45,12 @@ class Video extends Managed_DataObject
 
     public static function getByNotice($notice)
     {
-        return self::staticGet('uri', $notice->uri);
+        return self::getKV('uri', $notice->uri);
     }
 
     public function getNotice()
     {
-        return Notice::staticGet('uri', $this->uri);
+        return Notice::getKV('uri', $this->uri);
     }
 
     public static function schemaDef()
index 3046a6c837f8cb939c4575173e835c64f28fa62c..628d08642af2147cb064ec2c78bdd5e9bf3ebaaa 100644 (file)
@@ -38,7 +38,7 @@ class ShowvideoAction extends ShownoticeAction
     {
         OwnerDesignAction::prepare($args);
         $this->id = $this->trimmed('id');
-        $this->vid = Video::staticGet('id', $this->id);
+        $this->vid = Video::getKV('id', $this->id);
 
         if (empty($this->vid)) {
             throw new ClientException(_('No such video.'), 404);
@@ -50,7 +50,7 @@ class ShowvideoAction extends ShownoticeAction
             throw new ClientException(_('No such video'), 404);
         }
 
-        $this->user = User::staticGet('id', $this->vid->profile_id);
+        $this->user = User::getKV('id', $this->vid->profile_id);
 
         if (empty($this->user)) {
             throw new ClientException(_('No such user.'), 404);
index 6e31d699257383fcf924824743c7f9ed108d92ee..468e0eb92e10c84efc796719db4a8a01e336e138 100644 (file)
@@ -245,7 +245,7 @@ class GroupPrivateMessagePlugin extends Plugin
         $gps = null;
 
         if (!empty($form->group)) {
-            $gps = Group_privacy_settings::staticGet('group_id', $form->group->id);
+            $gps = Group_privacy_settings::getKV('group_id', $form->group->id);
         }
 
         $form->out->elementStart('li');
@@ -286,7 +286,7 @@ class GroupPrivateMessagePlugin extends Plugin
         $gps = null;
 
         if (!empty($action->group)) {
-            $gps = Group_privacy_settings::staticGet('group_id', $action->group->id);
+            $gps = Group_privacy_settings::getKV('group_id', $action->group->id);
         }
 
         $orig = null;
@@ -441,7 +441,7 @@ class GroupPrivateMessagePlugin extends Plugin
                                "but group ".$group->nickname." does not allow them.");
                 }
 
-                $user = User::staticGet('id', $notice->profile_id);
+                $user = User::getKV('id', $notice->profile_id);
 
                 if (empty($user)) {
                     common_log(LOG_WARNING,
index a74f7cd60abfe69e0086a86ecb086c9abfabb9f7..05fcdc5c43aa56cb8b7862a4ad79831f7b941fb6 100644 (file)
@@ -151,7 +151,7 @@ class Group_message extends Managed_DataObject
 
     function distribute()
     {
-        $group = User_group::staticGet('id', $this->to_group);
+        $group = User_group::getKV('id', $this->to_group);
 
         $member = $group->getMembers();
 
@@ -162,7 +162,7 @@ class Group_message extends Managed_DataObject
 
     function getGroup()
     {
-        $group = User_group::staticGet('id', $this->to_group);
+        $group = User_group::getKV('id', $this->to_group);
         if (empty($group)) {
             // TRANS: Exception thrown when trying to send group private message to a non-existing group.
             throw new ServerException(_m('No group for group message.'));
@@ -172,7 +172,7 @@ class Group_message extends Managed_DataObject
 
     function getSender()
     {
-        $sender = Profile::staticGet('id', $this->from_profile);
+        $sender = Profile::getKV('id', $this->from_profile);
         if (empty($sender)) {
             // TRANS: Exception thrown when trying to send group private message without having a sender.
             throw new ServerException(_m('No sender for group message.'));
index b059222dcccfc80af5e1f6b920c79d5d9650da9e..845997f21ff3ae448c43a9620b43316ec299bc4b 100644 (file)
@@ -126,15 +126,15 @@ class Group_message_profile extends Managed_DataObject
 
     function notifyByMail()
     {
-        $to = User::staticGet('id', $this->to_profile);
+        $to = User::getKV('id', $this->to_profile);
 
         if (empty($to) || is_null($to->email) || !$to->emailnotifymsg) {
             return true;
         }
 
-        $gm = Group_message::staticGet('id', $this->group_message_id);
+        $gm = Group_message::getKV('id', $this->group_message_id);
 
-        $from_profile = Profile::staticGet('id', $gm->from_profile);
+        $from_profile = Profile::getKV('id', $gm->from_profile);
 
         $group = $gm->getGroup();
 
index a325dd95f140f336b8d75da3fe6589644d7ee689..771c2ec7824fa888ada964769a9bca3254eb0e84 100644 (file)
@@ -126,7 +126,7 @@ class Group_privacy_settings extends Managed_DataObject
 
     function forGroup($group)
     {
-        $gps = Group_privacy_settings::staticGet('group_id', $group->id);
+        $gps = Group_privacy_settings::getKV('group_id', $group->id);
 
         if (empty($gps)) {
             // make a fake one with defaults
index b6308c663f9382d9e0efc42b3577cc2b263ec883..84952d0b062cf116e73deb6fe815055de8ba13e0 100644 (file)
@@ -76,14 +76,14 @@ class GroupinboxAction extends GroupAction
             return false;
         }
 
-        $localGroup = Local_group::staticGet('nickname', $nickname);
+        $localGroup = Local_group::getKV('nickname', $nickname);
 
         if (empty($localGroup)) {
             // TRANS: Client exception thrown when trying to view group inbox for non-existing group.
             throw new ClientException(_m('No such group.'), 404);
         }
 
-        $this->group = User_group::staticGet('id', $localGroup->group_id);
+        $this->group = User_group::getKV('id', $localGroup->group_id);
 
         if (empty($this->group)) {
             // TRANS: Client exception thrown when trying to view group inbox for non-existing group.
index 4ba659eacc83b863c7281b1b85e2440338e3a05f..37738a385ca1bce189af3f17551c0e008041ae7f 100644 (file)
@@ -84,14 +84,14 @@ class NewgroupmessageAction extends Action
             return false;
         }
 
-        $localGroup = Local_group::staticGet('nickname', $nickname);
+        $localGroup = Local_group::getKV('nickname', $nickname);
 
         if (empty($localGroup)) {
             // TRANS: Client exception thrown when trying to send a private group message to a non-existing group.
             throw new ClientException(_m('No such group.'), 404);
         }
 
-        $this->group = User_group::staticGet('id', $localGroup->group_id);
+        $this->group = User_group::getKV('id', $localGroup->group_id);
 
         if (empty($this->group)) {
             // TRANS: Client exception thrown when trying to send a private group message to a non-existing group.
index a0ec4198c43376d30c58409bddd572679efdd711..8b99ece2758347fb812cedf60111209aabb6d2a0 100644 (file)
@@ -72,14 +72,14 @@ class ShowgroupmessageAction extends Action
 
         $id = $this->trimmed('id');
 
-        $this->gm = Group_message::staticGet('id', $id);
+        $this->gm = Group_message::getKV('id', $id);
 
         if (empty($this->gm)) {
             // TRANS: Client exception thrown when trying to view a non-existing group private message.
             throw new ClientException(_m('No such message.'), 404);
         }
 
-        $this->group = User_group::staticGet('id', $this->gm->to_group);
+        $this->group = User_group::getKV('id', $this->gm->to_group);
 
         if (empty($this->group)) {
             // TRANS: Server exception thrown when trying to view group private messages for a non-exsting group.
@@ -91,7 +91,7 @@ class ShowgroupmessageAction extends Action
             throw new ClientException(_m('Cannot read message.'), 403);
         }
 
-        $this->sender = Profile::staticGet('id', $this->gm->from_profile);
+        $this->sender = Profile::getKV('id', $this->gm->from_profile);
 
         if (empty($this->sender)) {
             // TRANS: Server exception thrown when trying to view a group private message without a sender.
index 856e00e159e51d6a81e4a948466a2993c3b666a2..15f3b941d703be0de8a9216b62a84258c8a192b6 100644 (file)
@@ -66,7 +66,7 @@ class MapAction extends Action
             return false;
         }
 
-        $this->user = User::staticGet('nickname', $nickname);
+        $this->user = User::getKV('nickname', $nickname);
 
         if (!$this->user) {
             // TRANS: Client error displayed when referring to a non-existing user.
@@ -151,7 +151,7 @@ class MapAction extends Action
         $arr['source'] = $arr['source'];
 
         if (!empty($notice->reply_to)) {
-            $reply_to = Notice::staticGet('id', $notice->reply_to);
+            $reply_to = Notice::getKV('id', $notice->reply_to);
             if (!empty($reply_to)) {
                 $arr['in_reply_to_status_url'] = $reply_to->bestUrl();
             }
index 459df63e8213eeac24b87f6b370d7450ad7c365a..48229232f27f7a52356f1a68a95e45454ba48882 100644 (file)
@@ -174,7 +174,7 @@ class ModLogPlugin extends Plugin
                 $action->element('td', null, sprintf(($ml->is_grant) ? _('+%s') : _('-%s'), $ml->role));
                 $action->elementStart('td');
                 if ($ml->moderator_id) {
-                    $mod = Profile::staticGet('id', $ml->moderator_id);
+                    $mod = Profile::getKV('id', $ml->moderator_id);
                     if (empty($mod)) {
                         $action->text(_('[unknown]'));
                     } else {
index 95265c52ca3459ada012a567cf42e5c94327de93..c8c88c9d7a391bc5095797cfaa30a7726a68d09c 100644 (file)
@@ -134,7 +134,7 @@ class ModPlusPlugin extends Plugin
      */
     protected function showProfileOptions(HTMLOutputter $out, $profile)
     {
-        $isRemote = !(User::staticGet('id', $profile->id));
+        $isRemote = !(User::getKV('id', $profile->id));
         if ($isRemote) {
             $target = common_local_url('remoteprofile', array('id' => $profile->id));
             // TRANS: Label for access to remote profile options.
index 1d7a84d9f3dffad7e3c485638eacd4b3c78ba155..bfcc5a84ca300e0056de20b0b13d7a5875664b29 100644 (file)
@@ -12,7 +12,7 @@ class RemoteProfileAction extends ShowstreamAction
 
         $id = $this->arg('id');
         $this->user = false;
-        $this->profile = Profile::staticGet('id', $id);
+        $this->profile = Profile::getKV('id', $id);
 
         if (!$this->profile) {
             // TRANS: Error message displayed when referring to a user without a profile.
@@ -20,7 +20,7 @@ class RemoteProfileAction extends ShowstreamAction
             return false;
         }
 
-        $user = User::staticGet('id', $this->profile->id);
+        $user = User::getKV('id', $this->profile->id);
         if ($user) {
             // This is a local user -- send to their regular profile.
             $url = common_local_url('showstream', array('nickname' => $user->nickname));
index 39df2621acacd1b90923ebd4db352578474d68ee..b2efe8345b9f33b9dbef0fef854238874d84e0b6 100644 (file)
@@ -279,7 +279,7 @@ class NoticeTitlePlugin extends Plugin
      */
     function onNoticeDeleteRelated($notice)
     {
-        $nt = Notice_title::staticGet('notice_id', $notice->id);
+        $nt = Notice_title::getKV('notice_id', $notice->id);
 
         if (!empty($nt)) {
             $nt->delete();
index 17dc8bdd1e2e1b70a15886144bbbc30fbbb06bc1..fff59c43a1e49c70da396b4e0f40bd2e3c5f708c 100644 (file)
@@ -105,7 +105,7 @@ class Notice_title extends Managed_DataObject
      */
     static function fromNotice($notice)
     {
-        $nt = Notice_title::staticGet('notice_id', $notice->id);
+        $nt = Notice_title::getKV('notice_id', $notice->id);
         if (empty($nt)) {
             return null;
         } else {
index de0088cc8e60789b35ec055db76ec6b06f5d91ae..fe4510f4a702f99ebfdf1c5f102edc5eb66b5faa 100644 (file)
@@ -190,7 +190,7 @@ class OMBPlugin extends Plugin
      */
     function onStartGetProfileUri($profile, &$uri)
     {
-        $remote = Remote_profile::staticGet('id', $this->id);
+        $remote = Remote_profile::getKV('id', $this->id);
         if (!empty($remote)) {
             $uri = $remote->uri;
             return false;
@@ -206,7 +206,7 @@ class OMBPlugin extends Plugin
      */
     function onStartShowProfileListSubscribeButton($action)
     {
-        $remote = Remote_profile::staticGet('id', $action->profile->id);
+        $remote = Remote_profile::getKV('id', $action->profile->id);
         if (empty($remote)) {
             false;
         }
@@ -225,7 +225,7 @@ class OMBPlugin extends Plugin
         // OMB 0.1 doesn't have a mechanism for local-server-
         // originated subscription.
 
-        $omb01 = Remote_profile::staticGet('id', $other_id);
+        $omb01 = Remote_profile::getKV('id', $other_id);
 
         if (!empty($omb01)) {
             throw new ClientException(
@@ -252,7 +252,7 @@ class OMBPlugin extends Plugin
         // OMB 0.1 doesn't have a mechanism for local-server-
         // originated tag.
 
-        $omb01 = Remote_profile::staticGet('id', $tagged_profile->id);
+        $omb01 = Remote_profile::getKV('id', $tagged_profile->id);
 
         if (!empty($omb01)) {
             $this->clientError(
@@ -276,7 +276,7 @@ class OMBPlugin extends Plugin
         // OMB 0.1 doesn't have a mechanism for local-server-
         // originated tag.
 
-        $omb01 = Remote_profile::staticGet('id', $ptag->tagged);
+        $omb01 = Remote_profile::getKV('id', $ptag->tagged);
 
         if (!empty($omb01)) {
             $this->clientError(
@@ -339,9 +339,9 @@ class OMBPlugin extends Plugin
      */
     function onStartGetProfileFromURI($uri, &$profile)
     {
-        $remote_profile = Remote_profile::staticGet('uri', $uri);
+        $remote_profile = Remote_profile::getKV('uri', $uri);
         if (!empty($remote_profile)) {
-            $profile = Profile::staticGet('id', $remote_profile->profile_id);
+            $profile = Profile::getKV('id', $remote_profile->profile_id);
             return false;
         }
 
@@ -357,7 +357,7 @@ class OMBPlugin extends Plugin
      */
     function onStartCommonProfileURI($profile, &$uri)
     {
-        $remote = Remote_profile::staticGet($profile->id);
+        $remote = Remote_profile::getKV($profile->id);
         if ($remote) {
             $uri = $remote->uri;
             return false;
index fb98dbda6d595efb198a21af2c98978e42f35c0c..e933716f9e92931e5a1bc199d74011c8cad59041 100644 (file)
@@ -74,7 +74,7 @@ class FinishremotesubscribeAction extends Action
 
         /* Create user objects for both users. Do it early for request
            validation. */
-        $user = User::staticGet('uri', $service->getListeneeURI());
+        $user = User::getKV('uri', $service->getListeneeURI());
 
         if (!$user) {
             // TRANS: Client error displayed when subscribing to a remote profile that does not exist.
@@ -82,7 +82,7 @@ class FinishremotesubscribeAction extends Action
             return;
         }
 
-        $other = User::staticGet('uri', $service->getListenerURI());
+        $other = User::getKV('uri', $service->getListenerURI());
 
         if ($other) {
             // TRANS: Client error displayed when subscribing to a remote profile that is a local profile.
@@ -90,12 +90,12 @@ class FinishremotesubscribeAction extends Action
             return;
         }
 
-        $remote = Remote_profile::staticGet('uri', $service->getListenerURI());
+        $remote = Remote_profile::getKV('uri', $service->getListenerURI());
         if ($remote) {
             // Note remote profile may not have been saved yet.
             // @fixme not convinced this is correct at all!
 
-            $profile = Profile::staticGet($remote->id);
+            $profile = Profile::getKV($remote->id);
 
             if ($user->hasBlocked($profile)) {
                 // TRANS: Client error displayed when subscribing to a remote profile that is blocked form subscribing to.
@@ -132,7 +132,7 @@ class FinishremotesubscribeAction extends Action
 
         /* The service URLs are not accessible from datastore, so setting them
            after insertion of the profile. */
-        $remote = Remote_profile::staticGet('uri', $service->getListenerURI());
+        $remote = Remote_profile::getKV('uri', $service->getListenerURI());
         $orig_remote = clone($remote);
 
         $remote->postnoticeurl    =
index aafbaf5216fb8ed6d4573b15910ab3f23073cabb..1f7b9c08390e71510608ba1088b4370faa9707ba 100644 (file)
@@ -157,7 +157,7 @@ class RemotesubscribeAction extends Action
             return;
         }
 
-        $user = User::staticGet('nickname', $this->nickname);
+        $user = User::getKV('nickname', $this->nickname);
 
         $this->profile_url = $this->trimmed('profile_url');
 
@@ -187,7 +187,7 @@ class RemotesubscribeAction extends Action
 
         if ($service->getServiceURI(OAUTH_ENDPOINT_REQUEST) ==
             common_local_url('requesttoken') ||
-            User::staticGet('uri', $service->getRemoteUserURI())) {
+            User::getKV('uri', $service->getRemoteUserURI())) {
             // TRANS: Form validation error on page for remote subscribe.
             $this->showForm(_('That is a local profile! Login to subscribe.'));
             return;
index 642a8dc3264ad70775105d75d785aa40defe0c67..848cc77a71561e49f73aa27d87a88f94240f28d9 100644 (file)
@@ -292,7 +292,7 @@ class UserauthorizationAction extends Action
         $nickname = $_GET['omb_listenee_nickname'];
         $profile  = $_GET['omb_listenee_profile'];
 
-        $user = User::staticGet('uri', $listener);
+        $user = User::getKV('uri', $listener);
         if (!$user) {
             // TRANS: Exception thrown when no valid user is found for an authorisation request.
             // TRANS: %s is a listener URI.
@@ -307,7 +307,7 @@ class UserauthorizationAction extends Action
                                         $listenee));
         }
 
-        $other = User::staticGet('uri', $listenee);
+        $other = User::getKV('uri', $listenee);
         if ($other) {
             // TRANS: Exception thrown when listenee URI is a local user for an authorisation request.
             // TRANS: %s is a listenee URI.
@@ -315,7 +315,7 @@ class UserauthorizationAction extends Action
                                         $listenee));
         }
 
-        $remote = Remote_profile::staticGet('uri', $listenee);
+        $remote = Remote_profile::getKV('uri', $listenee);
         if ($remote) {
             $sub             = new Subscription();
             $sub->subscriber = $user->id;
index 5e6758eded6290ac4379a9560cb4540e1da517be..8248d460e94fb31e4a33bfc46a6382341a168797 100644 (file)
@@ -65,7 +65,7 @@ class XrdsAction extends Action
     {
         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 providing a non-existing nickname.
             $this->clientError(_('No such user.'));
index 0804b65c369ea33c73e50bf919d11626842881d4..a2c3d7c45ed0a790b5fe06c6b42e7c5f0fc3359d 100644 (file)
@@ -113,7 +113,7 @@ function omb_broadcast_notice($notice)
 
 function omb_broadcast_profile($profile)
 {
-    $user = User::staticGet('id', $profile->id);
+    $user = User::getKV('id', $profile->id);
 
     if (!$user) {
         return false;
@@ -216,7 +216,7 @@ function profile_to_omb_profile($uri, $profile, $force = false)
 function notice_to_omb_notice($notice)
 {
     /* Create an OMB_Notice for $notice. */
-    $user = User::staticGet('id', $notice->profile_id);
+    $user = User::getKV('id', $notice->profile_id);
 
     if (!$user) {
         return null;
index c29eeb7696888430f5c00d8aa164d31e4bd35567..857748bf4af7ec38d90d24dbc4a11c924a1e9a85 100644 (file)
@@ -27,7 +27,7 @@ class OMBOAuthDataStore extends OAuthDataStore
     // We keep a record of who's contacted us
     function lookup_consumer($consumer_key)
     {
-        $con = Consumer::staticGet('consumer_key', $consumer_key);
+        $con = Consumer::getKV('consumer_key', $consumer_key);
         if (!$con) {
             $con = new Consumer();
             $con->consumer_key = $consumer_key;
@@ -126,7 +126,7 @@ class OMBOAuthDataStore extends OAuthDataStore
                 common_debug('request token "'.$rt->tok.'" updated', __FILE__);
                 // Update subscription
                 // XXX: mixing levels here
-                $sub = Subscription::staticGet('token', $rt->tok);
+                $sub = Subscription::getKV('token', $rt->tok);
                 if (!$sub) {
                     return null;
                 }
@@ -218,9 +218,9 @@ class OMBOAuthDataStore extends OAuthDataStore
     public function getProfile($identifier_uri) {
         /* getProfile is only used for remote profiles by libomb.
            @TODO: Make it work with local ones anyway. */
-        $remote = Remote_profile::staticGet('uri', $identifier_uri);
+        $remote = Remote_profile::getKV('uri', $identifier_uri);
         if (!$remote) throw new Exception('No such remote profile');
-        $profile = Profile::staticGet('id', $remote->id);
+        $profile = Profile::getKV('id', $remote->id);
         if (!$profile) throw new Exception('No profile for remote user');
 
         require_once dirname(__FILE__) . '/omb.php';
@@ -242,11 +242,11 @@ class OMBOAuthDataStore extends OAuthDataStore
                                                 $omb_profile->getProfileURL()) {
             throw new Exception('Not implemented');
         } else {
-            $remote = Remote_profile::staticGet('uri', $omb_profile->getIdentifierURI());
+            $remote = Remote_profile::getKV('uri', $omb_profile->getIdentifierURI());
 
             if ($remote) {
                 $exists = true;
-                $profile = Profile::staticGet($remote->id);
+                $profile = Profile::getKV($remote->id);
                 $orig_remote = clone($remote);
                 $orig_profile = clone($profile);
                 // XXX: compare current postNotice and updateProfile URLs to the ones
@@ -346,15 +346,15 @@ class OMBOAuthDataStore extends OAuthDataStore
      * @access public
      **/
     public function saveNotice(&$omb_notice) {
-        if (Notice::staticGet('uri', $omb_notice->getIdentifierURI())) {
+        if (Notice::getKV('uri', $omb_notice->getIdentifierURI())) {
             // TRANS: Exception thrown when a notice is denied because it has been sent before.
             throw new Exception(_('Duplicate notice.'));
         }
         $author_uri = $omb_notice->getAuthor()->getIdentifierURI();
         common_log(LOG_DEBUG, $author_uri, __FILE__);
-        $author = Remote_profile::staticGet('uri', $author_uri);
+        $author = Remote_profile::getKV('uri', $author_uri);
         if (!$author) {
-            $author = User::staticGet('uri', $author_uri);
+            $author = User::getKV('uri', $author_uri);
         }
         if (!$author) {
             throw new Exception('No such user.');
@@ -406,9 +406,9 @@ class OMBOAuthDataStore extends OAuthDataStore
 
     private function _getAnyProfile($uri)
     {
-        $user = Remote_profile::staticGet('uri', $uri);
+        $user = Remote_profile::getKV('uri', $uri);
         if (!$user) {
-            $user = User::staticGet('uri', $uri);
+            $user = User::getKV('uri', $uri);
         }
         if (!$user) {
             throw new Exception('No such user.');
@@ -503,7 +503,7 @@ class OMBOAuthDataStore extends OAuthDataStore
 
         if ($subscribed instanceof User) {
             mail_subscribe_notify_profile($subscribed,
-                                          Profile::staticGet($subscriber->id));
+                                          Profile::getKV($subscriber->id));
         }
     }
 }
index bc70edb09582e154eac9e1235c5ca70386f5ef5f..df443513fa505cd4220f6eab2a033c110342f769 100644 (file)
@@ -50,7 +50,7 @@ class OmbQueueHandler extends QueueHandler
 
     function is_remote($notice)
     {
-        $user = User::staticGet($notice->profile_id);
+        $user = User::getKV($notice->profile_id);
         return is_null($user);
     }
 }
index 43b90cfbf7db7ef706b14cf7d469ecb7b3842459..567989c11e85bc8cdeacc9aa78f898abdfc03892 100644 (file)
@@ -600,7 +600,7 @@ class OStatusPlugin extends Plugin
      */
     function onStartFeedSubReceive($feedsub, $feed)
     {
-        $oprofile = Ostatus_profile::staticGet('feeduri', $feedsub->uri);
+        $oprofile = Ostatus_profile::getKV('feeduri', $feedsub->uri);
         if ($oprofile) {
             $oprofile->processFeed($feed, 'push');
         } else {
@@ -619,7 +619,7 @@ class OStatusPlugin extends Plugin
      */
     function onFeedSubSubscriberCount($feedsub, &$count)
     {
-        $oprofile = Ostatus_profile::staticGet('feeduri', $feedsub->uri);
+        $oprofile = Ostatus_profile::getKV('feeduri', $feedsub->uri);
         if ($oprofile) {
             $count += $oprofile->subscriberCount();
         }
@@ -642,13 +642,13 @@ class OStatusPlugin extends Plugin
      */
     function onStartSubscribe($subscriber, $other)
     {
-        $user = User::staticGet('id', $subscriber->id);
+        $user = User::getKV('id', $subscriber->id);
 
         if (empty($user)) {
             return true;
         }
 
-        $oprofile = Ostatus_profile::staticGet('profile_id', $other->id);
+        $oprofile = Ostatus_profile::getKV('profile_id', $other->id);
 
         if (empty($oprofile)) {
             return true;
@@ -673,13 +673,13 @@ class OStatusPlugin extends Plugin
      */
     function onEndSubscribe($subscriber, $other)
     {
-        $user = User::staticGet('id', $subscriber->id);
+        $user = User::getKV('id', $subscriber->id);
 
         if (empty($user)) {
             return true;
         }
 
-        $oprofile = Ostatus_profile::staticGet('profile_id', $other->id);
+        $oprofile = Ostatus_profile::getKV('profile_id', $other->id);
 
         if (empty($oprofile)) {
             return true;
@@ -705,13 +705,13 @@ class OStatusPlugin extends Plugin
      */
     function onEndUnsubscribe($profile, $other)
     {
-        $user = User::staticGet('id', $profile->id);
+        $user = User::getKV('id', $profile->id);
 
         if (empty($user)) {
             return true;
         }
 
-        $oprofile = Ostatus_profile::staticGet('profile_id', $other->id);
+        $oprofile = Ostatus_profile::getKV('profile_id', $other->id);
 
         if (empty($oprofile)) {
             return true;
@@ -758,7 +758,7 @@ class OStatusPlugin extends Plugin
      */
     function onStartJoinGroup($group, $profile)
     {
-        $oprofile = Ostatus_profile::staticGet('group_id', $group->id);
+        $oprofile = Ostatus_profile::getKV('group_id', $group->id);
         if ($oprofile) {
             if (!$oprofile->subscribe()) {
                 // TRANS: Exception thrown when setup of remote group membership fails.
@@ -813,7 +813,7 @@ class OStatusPlugin extends Plugin
      */
     function onEndLeaveGroup($group, $profile)
     {
-        $oprofile = Ostatus_profile::staticGet('group_id', $group->id);
+        $oprofile = Ostatus_profile::getKV('group_id', $group->id);
         if ($oprofile) {
             // Drop the PuSH subscription if there are no other subscribers.
             $oprofile->garbageCollect();
@@ -856,7 +856,7 @@ class OStatusPlugin extends Plugin
 
     function onStartSubscribePeopletag($peopletag, $user)
     {
-        $oprofile = Ostatus_profile::staticGet('peopletag_id', $peopletag->id);
+        $oprofile = Ostatus_profile::getKV('peopletag_id', $peopletag->id);
         if ($oprofile) {
             if (!$oprofile->subscribe()) {
                 // TRANS: Exception thrown when setup of remote list subscription fails.
@@ -864,7 +864,7 @@ class OStatusPlugin extends Plugin
             }
 
             $sub = $user->getProfile();
-            $tagger = Profile::staticGet($peopletag->tagger);
+            $tagger = Profile::getKV($peopletag->tagger);
 
             $act = new Activity();
             $act->id = TagURI::mint('subscribe_peopletag:%d:%d:%s',
@@ -908,13 +908,13 @@ class OStatusPlugin extends Plugin
 
     function onEndUnsubscribePeopletag($peopletag, $user)
     {
-        $oprofile = Ostatus_profile::staticGet('peopletag_id', $peopletag->id);
+        $oprofile = Ostatus_profile::getKV('peopletag_id', $peopletag->id);
         if ($oprofile) {
             // Drop the PuSH subscription if there are no other subscribers.
             $oprofile->garbageCollect();
 
-            $sub = Profile::staticGet($user->id);
-            $tagger = Profile::staticGet($peopletag->tagger);
+            $sub = Profile::getKV($user->id);
+            $tagger = Profile::getKV($peopletag->tagger);
 
             $act = new Activity();
             $act->id = TagURI::mint('unsubscribe_peopletag:%d:%d:%s',
@@ -949,13 +949,13 @@ class OStatusPlugin extends Plugin
      */
     function onEndFavorNotice(Profile $profile, Notice $notice)
     {
-        $user = User::staticGet('id', $profile->id);
+        $user = User::getKV('id', $profile->id);
 
         if (empty($user)) {
             return true;
         }
 
-        $oprofile = Ostatus_profile::staticGet('profile_id', $notice->profile_id);
+        $oprofile = Ostatus_profile::getKV('profile_id', $notice->profile_id);
 
         if (empty($oprofile)) {
             return true;
@@ -986,7 +986,7 @@ class OStatusPlugin extends Plugin
      */
     function onEndTagProfile($ptag)
     {
-        $oprofile = Ostatus_profile::staticGet('profile_id', $ptag->tagged);
+        $oprofile = Ostatus_profile::getKV('profile_id', $ptag->tagged);
 
         if (empty($oprofile)) {
             return true;
@@ -1000,7 +1000,7 @@ class OStatusPlugin extends Plugin
         $act = new Activity();
 
         $tagger = $plist->getTagger();
-        $tagged = Profile::staticGet('id', $ptag->tagged);
+        $tagged = Profile::getKV('id', $ptag->tagged);
 
         $act->verb = ActivityVerb::TAG;
         $act->id   = TagURI::mint('tag_profile:%d:%d:%s',
@@ -1043,7 +1043,7 @@ class OStatusPlugin extends Plugin
      */
     function onEndUntagProfile($ptag)
     {
-        $oprofile = Ostatus_profile::staticGet('profile_id', $ptag->tagged);
+        $oprofile = Ostatus_profile::getKV('profile_id', $ptag->tagged);
 
         if (empty($oprofile)) {
             return true;
@@ -1057,7 +1057,7 @@ class OStatusPlugin extends Plugin
         $act = new Activity();
 
         $tagger = $plist->getTagger();
-        $tagged = Profile::staticGet('id', $ptag->tagged);
+        $tagged = Profile::getKV('id', $ptag->tagged);
 
         $act->verb = ActivityVerb::UNTAG;
         $act->id   = TagURI::mint('untag_profile:%d:%d:%s',
@@ -1095,13 +1095,13 @@ class OStatusPlugin extends Plugin
      */
     function onEndDisfavorNotice(Profile $profile, Notice $notice)
     {
-        $user = User::staticGet('id', $profile->id);
+        $user = User::getKV('id', $profile->id);
 
         if (empty($user)) {
             return true;
         }
 
-        $oprofile = Ostatus_profile::staticGet('profile_id', $notice->profile_id);
+        $oprofile = Ostatus_profile::getKV('profile_id', $notice->profile_id);
 
         if (empty($oprofile)) {
             return true;
@@ -1133,7 +1133,7 @@ class OStatusPlugin extends Plugin
 
     function onStartGetProfileUri($profile, &$uri)
     {
-        $oprofile = Ostatus_profile::staticGet('profile_id', $profile->id);
+        $oprofile = Ostatus_profile::getKV('profile_id', $profile->id);
         if (!empty($oprofile)) {
             $uri = $oprofile->uri;
             return false;
@@ -1148,7 +1148,7 @@ class OStatusPlugin extends Plugin
 
     function onStartUserGroupPermalink($group, &$url)
     {
-        $oprofile = Ostatus_profile::staticGet('group_id', $group->id);
+        $oprofile = Ostatus_profile::getKV('group_id', $group->id);
         if ($oprofile) {
             // @fixme this should probably be in the user_group table
             // @fixme this uri not guaranteed to be a profile page
@@ -1207,7 +1207,7 @@ class OStatusPlugin extends Plugin
      */
     function onEndBroadcastProfile(Profile $profile)
     {
-        $user = User::staticGet('id', $profile->id);
+        $user = User::getKV('id', $profile->id);
 
         // Find foreign accounts I'm subscribed to that support Salmon pings.
         //
@@ -1255,7 +1255,7 @@ class OStatusPlugin extends Plugin
     {
         if (!common_logged_in()) {
 
-            $profileUser = User::staticGet('id', $item->profile->id);
+            $profileUser = User::getKV('id', $item->profile->id);
 
             if (!empty($profileUser)) {
 
@@ -1312,9 +1312,9 @@ class OStatusPlugin extends Plugin
      */
     public static function localGroupFromUrl($url)
     {
-        $group = User_group::staticGet('uri', $url);
+        $group = User_group::getKV('uri', $url);
         if ($group) {
-            $local = Local_group::staticGet('group_id', $group->id);
+            $local = Local_group::getKV('group_id', $group->id);
             if ($local) {
                 return $group->id;
             }
@@ -1334,7 +1334,7 @@ class OStatusPlugin extends Plugin
 
     public function onStartProfileGetAtomFeed($profile, &$feed)
     {
-        $oprofile = Ostatus_profile::staticGet('profile_id', $profile->id);
+        $oprofile = Ostatus_profile::getKV('profile_id', $profile->id);
 
         if (empty($oprofile)) {
             return true;
@@ -1349,7 +1349,7 @@ class OStatusPlugin extends Plugin
         // Don't want to do Web-based discovery on our own server,
         // so we check locally first.
 
-        $user = User::staticGet('uri', $uri);
+        $user = User::getKV('uri', $uri);
 
         if (!empty($user)) {
             $profile = $user->getProfile();
@@ -1392,7 +1392,7 @@ class OStatusPlugin extends Plugin
                               'href' => $salmon_url);
 
         // Get this user's keypair
-        $magickey = Magicsig::staticGet('user_id', $user->id);
+        $magickey = Magicsig::getKV('user_id', $user->id);
         if (!$magickey) {
             // No keypair yet, let's generate one.
             $magickey = new Magicsig();
index 0a43c37237ff2942e1726f78d4f8b636b9366319..14e66f5ca008f481f0abc06a99cef9308949a681 100644 (file)
@@ -40,7 +40,7 @@ class GroupsalmonAction extends SalmonAction
             $this->clientError(_m('No ID.'));
         }
 
-        $this->group = User_group::staticGet('id', $id);
+        $this->group = User_group::getKV('id', $id);
 
         if (empty($this->group)) {
             // TRANS: Client error.
@@ -50,7 +50,7 @@ class GroupsalmonAction extends SalmonAction
 
         $this->target = $this->group;
 
-        $oprofile = Ostatus_profile::staticGet('group_id', $id);
+        $oprofile = Ostatus_profile::getKV('group_id', $id);
         if ($oprofile) {
             // TRANS: Client error.
             $this->clientError(_m('Cannot accept remote posts for a remote group.'));
index 1c862aa9974351f3269f368ca4e08ee2bed7dbcd..c7c8baa5265b1ad4327cf541b1d80e0d6d633a65 100644 (file)
@@ -214,7 +214,7 @@ class OStatusInitAction extends Action
     function targetProfile()
     {
         if ($this->nickname) {
-            $user = User::staticGet('nickname', $this->nickname);
+            $user = User::getKV('nickname', $this->nickname);
             if ($user) {
                 return common_local_url('userbyid', array('id' => $user->id));
             } else {
@@ -222,7 +222,7 @@ class OStatusInitAction extends Action
                 $this->clientError(_m('No such user.'));
             }
         } else if ($this->group) {
-            $group = Local_group::staticGet('nickname', $this->group);
+            $group = Local_group::getKV('nickname', $this->group);
             if ($group) {
                 return common_local_url('groupbyid', array('id' => $group->group_id));
             } else {
@@ -230,7 +230,7 @@ class OStatusInitAction extends Action
                 $this->clientError(_m('No such group.'));
             }
         } else if ($this->peopletag && $this->tagger) {
-            $user = User::staticGet('nickname', $this->tagger);
+            $user = User::getKV('nickname', $this->tagger);
             if (empty($user)) {
                 // TRANS: Client error.
                 $this->clientError(_m('No such user.'));
index 19e56cb216a947b8a10eb4d7e6710200059e91c9..12af8c2b31ce957f7eb19bd842c22498efcca986 100644 (file)
@@ -40,14 +40,14 @@ class PeopletagsalmonAction extends SalmonAction
             $this->clientError(_m('No ID.'));
         }
 
-        $this->peopletag = Profile_list::staticGet('id', $id);
+        $this->peopletag = Profile_list::getKV('id', $id);
 
         if (empty($this->peopletag)) {
             // TRANS: Client error displayed when referring to a non-existing list.
             $this->clientError(_m('No such list.'));
         }
 
-        $oprofile = Ostatus_profile::staticGet('peopletag_id', $id);
+        $oprofile = Ostatus_profile::getKV('peopletag_id', $id);
 
         if (!empty($oprofile)) {
             // TRANS: Client error displayed when trying to send a message to a remote list.
index 9252ac61a1c8620495fa66575d5d86840cc60312..397aa56b9073af9117b767fd0fc8faaba328a4c0 100644 (file)
@@ -51,7 +51,7 @@ class PushCallbackAction extends Action
             throw new ServerException(_m('Empty or invalid feed id.'), 400);
         }
 
-        $feedsub = FeedSub::staticGet('id', $feedid);
+        $feedsub = FeedSub::getKV('id', $feedid);
         if (!$feedsub) {
             // TRANS: Server exception. %s is a feed ID.
             throw new ServerException(sprintf(_m('Unknown PuSH feed id %s'),$feedid), 400);
@@ -91,7 +91,7 @@ class PushCallbackAction extends Action
             throw new ClientException(sprintf(_m('Bad hub.mode "$s".',$mode)), 404);
         }
 
-        $feedsub = FeedSub::staticGet('uri', $topic);
+        $feedsub = FeedSub::getKV('uri', $topic);
         if (!$feedsub) {
             // TRANS: Client exception. %s is an invalid feed name.
             throw new ClientException(sprintf(_m('Bad hub.topic feed "%s".'),$topic), 404);
index e9dca7ab9d8181d3cb232288015430abd0852826..6e0968bd55f8daaac2a564152d477263811a7024 100644 (file)
@@ -109,7 +109,7 @@ class PushHubAction extends Action
             throw new ClientException(sprintf(_m('Invalid hub.secret "%s". It must be under 200 bytes.'),$secret));
         }
 
-        $sub = HubSub::staticGet($topic, $callback);
+        $sub = HubSub::getKV($topic, $callback);
         if (!$sub) {
             // Creating a new one!
             $sub = new HubSub();
@@ -155,7 +155,7 @@ class PushHubAction extends Action
             $groupFeed = common_local_url('ApiTimelineGroup', $params);
 
             if ($feed == $userFeed) {
-                $user = User::staticGet('id', $id);
+                $user = User::getKV('id', $id);
                 if (!$user) {
                     // TRANS: Client exception. %s is a feed URL.
                     throw new ClientException(sprintt(_m('Invalid hub.topic "%s". User does not exist.'),$feed));
@@ -164,7 +164,7 @@ class PushHubAction extends Action
                 }
             }
             if ($feed == $groupFeed) {
-                $user = User_group::staticGet('id', $id);
+                $user = User_group::getKV('id', $id);
                 if (!$user) {
                     // TRANS: Client exception. %s is a feed URL.
                     throw new ClientException(sprintf(_m('Invalid hub.topic "%s". Group does not exist.'),$feed));
@@ -179,8 +179,8 @@ class PushHubAction extends Action
             $listFeed = common_local_url('ApiTimelineList', $params);
 
             if ($feed == $listFeed) {
-                $list = Profile_list::staticGet('id', $id);
-                $user = User::staticGet('id', $user);
+                $list = Profile_list::getKV('id', $id);
+                $user = User::getKV('id', $user);
                 if (!$list || !$user || $list->tagger != $user->id) {
                     // TRANS: Client exception. %s is a feed URL.
                     throw new ClientException(sprintf(_m('Invalid hub.topic %s; list does not exist.'),$feed));
@@ -221,6 +221,6 @@ class PushHubAction extends Action
      */
     protected function getSub($feed, $callback)
     {
-        return HubSub::staticGet($feed, $callback);
+        return HubSub::getKV($feed, $callback);
     }
 }
index bc91b31559247922cb5a309db1fb3d1c96ff43ff..ed2c7b3d5f787f46a1306d2acc7fc84119dd018c 100644 (file)
@@ -38,7 +38,7 @@ class UsersalmonAction extends SalmonAction
             $this->clientError(_m('No ID.'));
         }
 
-        $this->user = User::staticGet('id', $id);
+        $this->user = User::getKV('id', $id);
 
         if (empty($this->user)) {
             // TRANS: Client error displayed when referring to a non-existing user.
@@ -80,7 +80,7 @@ class UsersalmonAction extends SalmonAction
         $context = $this->activity->context;
 
         if (!empty($context->replyToID)) {
-            $notice = Notice::staticGet('uri', $context->replyToID);
+            $notice = Notice::getKV('uri', $context->replyToID);
             if (empty($notice)) {
                 // TRANS: Client exception.
                 throw new ClientException(_m('In reply to unknown notice.'));
@@ -102,7 +102,7 @@ class UsersalmonAction extends SalmonAction
             throw new ClientException(_m('Not to anyone in reply to anything.'));
         }
 
-        $existing = Notice::staticGet('uri', $this->activity->objects[0]->id);
+        $existing = Notice::getKV('uri', $this->activity->objects[0]->id);
 
         if (!empty($existing)) {
             common_log(LOG_ERR, "Not saving notice '{$existing->uri}'; already exists.");
@@ -197,7 +197,7 @@ class UsersalmonAction extends SalmonAction
                 return false;
             }
             // this is a peopletag
-            $tagged = User::staticGet('uri', $this->activity->objects[0]->id);
+            $tagged = User::getKV('uri', $this->activity->objects[0]->id);
 
             if (empty($tagged)) {
                 // TRANS: Client exception.
@@ -231,7 +231,7 @@ class UsersalmonAction extends SalmonAction
                 return false;
             }
             // this is a peopletag
-            $tagged = User::staticGet('uri', $this->activity->objects[0]->id);
+            $tagged = User::getKV('uri', $this->activity->objects[0]->id);
 
             if (empty($tagged)) {
                 // TRANS: Client exception.
@@ -281,7 +281,7 @@ class UsersalmonAction extends SalmonAction
             throw new ClientException(_m('Cannot handle that kind of object for liking/faving.'));
         }
 
-        $notice = Notice::staticGet('uri', $object->id);
+        $notice = Notice::getKV('uri', $object->id);
 
         if (empty($notice)) {
             // TRANS: Client exception. %s is an object ID.
index d7eabf33eefd440de0aec54891a58e578cc7762f..873742c03ce4b426dff67d2cfe50acf2ae887a49 100644 (file)
@@ -170,7 +170,7 @@ class FeedSub extends Managed_DataObject
     public function localProfile()
     {
         if ($this->profile_id) {
-            return Profile::staticGet('id', $this->profile_id);
+            return Profile::getKV('id', $this->profile_id);
         }
         return null;
     }
@@ -182,7 +182,7 @@ class FeedSub extends Managed_DataObject
     public function localGroup()
     {
         if ($this->group_id) {
-            return User_group::staticGet('id', $this->group_id);
+            return User_group::getKV('id', $this->group_id);
         }
         return null;
     }
@@ -194,7 +194,7 @@ class FeedSub extends Managed_DataObject
      */
     public static function ensureFeed($feeduri)
     {
-        $current = self::staticGet('uri', $feeduri);
+        $current = self::getKV('uri', $feeduri);
         if ($current) {
             return $current;
         }
index 66e7d30e967fa543ad22613d98b5151ac9857d85..4fcb74ea2aba5d3d84fabf39a32d20fdb292a3ca 100644 (file)
@@ -207,7 +207,7 @@ class HubSub extends Managed_DataObject
             throw new ClientException(sprintf(_m('Hub subscriber verification returned HTTP %s.'),$status));
         }
 
-        $old = HubSub::staticGet($this->topic, $this->callback);
+        $old = HubSub::getKV($this->topic, $this->callback);
         if ($mode == 'subscribe') {
             if ($old) {
                 $this->update($old);
@@ -293,7 +293,7 @@ class HubSub extends Managed_DataObject
         // destroy the result data for the parent query.
         // @fixme use clone() again when it's safe to copy an
         // individual item from a multi-item query again.
-        $sub = HubSub::staticGet($this->topic, $this->callback);
+        $sub = HubSub::getKV($this->topic, $this->callback);
         $data = array('sub' => $sub,
                       'atom' => $atom,
                       'retries' => $retries);
index 47817f28732b47cd4b4cb7377f45060b682c65bf..ba3d4f3eb4d0a40dab9dafc49de5a480a5e4b346 100644 (file)
@@ -83,7 +83,7 @@ class Ostatus_profile extends Managed_DataObject
     public function localProfile()
     {
         if ($this->profile_id) {
-            return Profile::staticGet('id', $this->profile_id);
+            return Profile::getKV('id', $this->profile_id);
         }
         return null;
     }
@@ -95,7 +95,7 @@ class Ostatus_profile extends Managed_DataObject
     public function localGroup()
     {
         if ($this->group_id) {
-            return User_group::staticGet('id', $this->group_id);
+            return User_group::getKV('id', $this->group_id);
         }
         return null;
     }
@@ -107,7 +107,7 @@ class Ostatus_profile extends Managed_DataObject
     public function localPeopletag()
     {
         if ($this->peopletag_id) {
-            return Profile_list::staticGet('id', $this->peopletag_id);
+            return Profile_list::getKV('id', $this->peopletag_id);
         }
         return null;
     }
@@ -228,7 +228,7 @@ class Ostatus_profile extends Managed_DataObject
      */
     public function garbageCollect()
     {
-        $feedsub = FeedSub::staticGet('uri', $this->feeduri);
+        $feedsub = FeedSub::getKV('uri', $this->feeduri);
         return $feedsub->garbageCollect();
     }
 
@@ -549,7 +549,7 @@ class Ostatus_profile extends Managed_DataObject
 
         $sourceUri = $activity->id;
 
-        $dupe = Notice::staticGet('uri', $sourceUri);
+        $dupe = Notice::getKV('uri', $sourceUri);
         if ($dupe) {
             common_log(LOG_INFO, "OStatus: ignoring duplicate post: $sourceUri");
             return $dupe;
@@ -651,7 +651,7 @@ class Ostatus_profile extends Managed_DataObject
             // Maintain direct reply associations
             // @todo 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;
@@ -722,7 +722,7 @@ class Ostatus_profile extends Managed_DataObject
         // protecting against duplicate saves. It isn't required to be a URL;
         // tag: URIs for instance are found in Google Buzz feeds.
         $sourceUri = $note->id;
-        $dupe = Notice::staticGet('uri', $sourceUri);
+        $dupe = Notice::getKV('uri', $sourceUri);
         if ($dupe) {
             common_log(LOG_INFO, "OStatus: ignoring duplicate post: $sourceUri");
             return $dupe;
@@ -821,7 +821,7 @@ class Ostatus_profile extends Managed_DataObject
             // Maintain direct reply associations
             // @todo 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;
@@ -902,7 +902,7 @@ class Ostatus_profile extends Managed_DataObject
         $replies = array();
         foreach (array_unique($attention_uris) as $recipient) {
             // Is the recipient a local user?
-            $user = User::staticGet('uri', $recipient);
+            $user = User::getKV('uri', $recipient);
             if ($user) {
                 // @todo FIXME: Sender verification, spam etc?
                 $replies[] = $recipient;
@@ -910,10 +910,10 @@ class Ostatus_profile extends Managed_DataObject
             }
 
             // Is the recipient a local group?
-            // $group = User_group::staticGet('uri', $recipient);
+            // $group = User_group::getKV('uri', $recipient);
             $id = OStatusPlugin::localGroupFromUrl($recipient);
             if ($id) {
-                $group = User_group::staticGet('id', $id);
+                $group = User_group::getKV('id', $id);
                 if ($group) {
                     // Deliver to all members of this local group if allowed.
                     $profile = $sender->localProfile();
@@ -1052,7 +1052,7 @@ class Ostatus_profile extends Managed_DataObject
      */
     static function getFromProfileURL($profile_url)
     {
-        $profile = Profile::staticGet('profileurl', $profile_url);
+        $profile = Profile::getKV('profileurl', $profile_url);
 
         if (empty($profile)) {
             return null;
@@ -1060,7 +1060,7 @@ class Ostatus_profile extends Managed_DataObject
 
         // Is it a known Ostatus profile?
 
-        $oprofile = Ostatus_profile::staticGet('profile_id', $profile->id);
+        $oprofile = Ostatus_profile::getKV('profile_id', $profile->id);
 
         if (!empty($oprofile)) {
             return $oprofile;
@@ -1068,7 +1068,7 @@ class Ostatus_profile extends Managed_DataObject
 
         // Is it a local user?
 
-        $user = User::staticGet('id', $profile->id);
+        $user = User::getKV('id', $profile->id);
 
         if (!empty($user)) {
             // @todo i18n FIXME: use sprintf and add i18n (?)
@@ -1392,7 +1392,7 @@ class Ostatus_profile extends Managed_DataObject
     protected static function getActivityObjectProfile($object)
     {
         $uri = self::getActivityObjectProfileURI($object);
-        return Ostatus_profile::staticGet('uri', $uri);
+        return Ostatus_profile::getKV('uri', $uri);
     }
 
     /**
@@ -1448,7 +1448,7 @@ class Ostatus_profile extends Managed_DataObject
             throw new Exception(_m('No profile URI.'));
         }
 
-        $user = User::staticGet('uri', $homeuri);
+        $user = User::getKV('uri', $homeuri);
         if ($user) {
             // TRANS: Exception.
             throw new Exception(_m('Local user cannot be referenced as remote.'));
@@ -1459,9 +1459,9 @@ class Ostatus_profile extends Managed_DataObject
             throw new Exception(_m('Local group cannot be referenced as remote.'));
         }
 
-        $ptag = Profile_list::staticGet('uri', $homeuri);
+        $ptag = Profile_list::getKV('uri', $homeuri);
         if ($ptag) {
-            $local_user = User::staticGet('id', $ptag->tagger);
+            $local_user = User::getKV('id', $ptag->tagger);
             if (!empty($local_user)) {
                 // TRANS: Exception.
                 throw new Exception(_m('Local list cannot be referenced as remote.'));
@@ -1862,14 +1862,14 @@ class Ostatus_profile extends Managed_DataObject
                 // TRANS: Exception.
                 throw new Exception(_m('Not a valid webfinger address.'));
             }
-            $oprofile = Ostatus_profile::staticGet('uri', $uri);
+            $oprofile = Ostatus_profile::getKV('uri', $uri);
             if (!empty($oprofile)) {
                 return $oprofile;
             }
         }
 
         // Try looking it up
-        $oprofile = Ostatus_profile::staticGet('uri', 'acct:'.$addr);
+        $oprofile = Ostatus_profile::getKV('uri', 'acct:'.$addr);
 
         if (!empty($oprofile)) {
             self::cacheSet(sprintf('ostatus_profile:webfinger:%s', $addr), $oprofile->uri);
@@ -2047,7 +2047,7 @@ class Ostatus_profile extends Managed_DataObject
 
         // First, try to query it
 
-        $oprofile = Ostatus_profile::staticGet('uri', $uri);
+        $oprofile = Ostatus_profile::getKV('uri', $uri);
 
         // If unfound, do discovery stuff
 
index 0ed6a3ec57ac686eb4b663d001c132d3c67e7a45..90ee6a8bd97e8ab79bb3fee636443328360381a9 100644 (file)
@@ -65,7 +65,7 @@ class HubPrepQueueHandler extends QueueHandler
             while (count($pushCallbacks) && $n < self::ROLLING_BATCH) {
                 $n++;
                 $callback = array_shift($pushCallbacks);
-                $sub = HubSub::staticGet($topic, $callback);
+                $sub = HubSub::getKV($topic, $callback);
                 if (!$sub) {
                     common_log(LOG_ERR, "Skipping PuSH delivery for deleted(?) consumer $callback on $topic");
                     continue;
index f5284057e3a85028f4fa290552fa544e8536be42..b2e84011289d1b3d0d3520e1d58178a7f96a30ec 100644 (file)
@@ -51,7 +51,7 @@ class OStatusQueueHandler extends QueueHandler
         assert($notice instanceof Notice);
 
         $this->notice = $notice;
-        $this->user = User::staticGet('id', $notice->profile_id);
+        $this->user = User::getKV('id', $notice->profile_id);
 
         try {
             $profile = $this->notice->getProfile();
@@ -63,7 +63,7 @@ class OStatusQueueHandler extends QueueHandler
         $this->pushUser();
 
         foreach ($notice->getGroups() as $group) {
-            $oprofile = Ostatus_profile::staticGet('group_id', $group->id);
+            $oprofile = Ostatus_profile::getKV('group_id', $group->id);
             if ($oprofile) {
                 $this->pingReply($oprofile);
             } else {
@@ -72,17 +72,17 @@ class OStatusQueueHandler extends QueueHandler
         }
         
         foreach ($notice->getReplies() as $profile_id) {
-            $oprofile = Ostatus_profile::staticGet('profile_id', $profile_id);
+            $oprofile = Ostatus_profile::getKV('profile_id', $profile_id);
             if ($oprofile) {
                 $this->pingReply($oprofile);
             }
         }
 
         if (!empty($this->notice->reply_to)) {
-            $replyTo = Notice::staticGet('id', $this->notice->reply_to);
+            $replyTo = Notice::getKV('id', $this->notice->reply_to);
             if (!empty($replyTo)) {
                 foreach($replyTo->getReplies() as $profile_id) {
-                    $oprofile = Ostatus_profile::staticGet('profile_id', $profile_id);
+                    $oprofile = Ostatus_profile::getKV('profile_id', $profile_id);
                     if ($oprofile) {
                         $this->pingReply($oprofile);
                     }
@@ -91,7 +91,7 @@ class OStatusQueueHandler extends QueueHandler
         }
 
         foreach ($notice->getProfileTags() as $ptag) {
-            $oprofile = Ostatus_profile::staticGet('peopletag_id', $ptag->id);
+            $oprofile = Ostatus_profile::getKV('peopletag_id', $ptag->id);
             if (!$oprofile) {
                 $this->pushPeopletag($ptag);
             }
@@ -243,7 +243,7 @@ class OStatusQueueHandler extends QueueHandler
 
     function groupFeedForNotice($group_id)
     {
-        $group = User_group::staticGet('id', $group_id);
+        $group = User_group::getKV('id', $group_id);
 
         $atom = new AtomGroupNoticeFeed($group);
         $atom->addEntryFromNotice($this->notice);
index ec1911653a9c7611f97d492cbe28d0c8a7a49a5b..9802baffe238823d3a28d993f31fad34e3c8e6f5 100644 (file)
@@ -41,7 +41,7 @@ class PushInQueueHandler extends QueueHandler
         $post = $data['post'];
         $hmac = $data['hmac'];
 
-        $feedsub = FeedSub::staticGet('id', $feedsub_id);
+        $feedsub = FeedSub::getKV('id', $feedsub_id);
         if ($feedsub) {
             try {
                 $feedsub->receive($post, $hmac);
index 8e101bf624d04d5f274970e8b5bd384d0c874449..c93b314f8ab4161b084eb1e469b84f6180d53fdf 100644 (file)
@@ -112,10 +112,10 @@ class Salmon
     {
         $magic_env = new $class();
 
-        $user = User::staticGet('id', $actor->id);
+        $user = User::getKV('id', $actor->id);
         if ($user->id) {
             // Use local key
-            $magickey = Magicsig::staticGet('user_id', $user->id);
+            $magickey = Magicsig::getKV('user_id', $user->id);
             if (!$magickey) {
                 // No keypair yet, let's generate one.
                 $magickey = new Magicsig();
index e70d5ff521d9e4793c458eef4772856785a4326b..3b98a34a87c09c82e520da012670092191aed053 100644 (file)
@@ -39,7 +39,7 @@ class SalmonQueueHandler extends QueueHandler
         assert(is_string($data['salmonuri']));
         assert(is_string($data['entry']));
 
-        $actor = Profile::staticGet($data['actor']);
+        $actor = Profile::getKV($data['actor']);
 
         $salmon = new Salmon();
         $salmon->post($data['salmonuri'], $data['entry'], $actor);
index 2ba158a3e6d58eba48f112c8277b9a48acab5802..779ce4d515fbe51451ce6935fd04f535d8cd925b 100644 (file)
@@ -101,7 +101,7 @@ class XrdAction extends Action
                               'href' => $salmon_url);
 
         // Get this user's keypair
-        $magickey = Magicsig::staticGet('user_id', $this->user->id);
+        $magickey = Magicsig::getKV('user_id', $this->user->id);
         if (!$magickey) {
             // No keypair yet, let's generate one.
             $magickey = new Magicsig();
index 18df2995fb56beede2cb53a5d7a4f06fa1b503d7..45e2d8c0b0cff3e80c97ec4e52b0967460e63773 100644 (file)
@@ -53,7 +53,7 @@ while ($user->fetch()) {
         echo " - skipping\n";
     } else {
         echo " - removing bogus ostatus_profile entry...";
-        $evil = Ostatus_profile::staticGet('uri', $uri);
+        $evil = Ostatus_profile::getKV('uri', $uri);
         $evil->delete();
         echo "  ok\n";
     }
@@ -77,7 +77,7 @@ while ($group->fetch()) {
         echo " - skipping\n";
     } else {
         echo " - removing bogus ostatus_profile entry...";
-        $evil = Ostatus_profile::staticGet('uri', $uri);
+        $evil = Ostatus_profile::getKV('uri', $uri);
         $evil->delete();
         echo "  ok\n";
     }
@@ -109,7 +109,7 @@ while ($group->fetch()) {
     $uri = $group->uri;
     if (preg_match('!/group/(\d+)/id!', $uri, $matches)) {
         $id = intval($matches[1]);
-        $local = Local_group::staticGet('group_id', $id);
+        $local = Local_group::getKV('group_id', $id);
         if ($local) {
             $nick = $local->nickname;
         } else {
@@ -120,7 +120,7 @@ while ($group->fetch()) {
             echo " - skipping\n";
         } else {
             echo " - removing bogus user_group entry...";
-            $evil = User_group::staticGet('id', $group->id);
+            $evil = User_group::getKV('id', $group->id);
             $evil->delete();
             echo "  ok\n";
         }
@@ -155,7 +155,7 @@ while ($oprofile->fetch()) {
     $uri = $oprofile->uri;
     if (preg_match('!/group/(\d+)/id!', $oprofile->uri, $matches)) {
         $id = intval($matches[1]);
-        $group = Local_group::staticGet('group_id', $id);
+        $group = Local_group::getKV('group_id', $id);
         if ($group) {
             $nick = $group->nickname;
         } else {
@@ -164,7 +164,7 @@ while ($oprofile->fetch()) {
         echo "group $id ($nick) hidden by $uri";
     } else if (preg_match('!/user/(\d+)!', $uri, $matches)) {
         $id = intval($matches[1]);
-        $user = User::staticGet('id', $id);
+        $user = User::getKV('id', $id);
         if ($user) {
             $nick = $user->nickname;
         } else {
index a08d837993df35e3746c60cd670bc86213d0bc5c..e4c64fdcc5aaf082f549769b109da02f8855ec59 100644 (file)
@@ -44,7 +44,7 @@ if (empty($args[0]) || !Validate::uri($args[0])) {
 $feedurl = $args[0];
 
 
-$sub = FeedSub::staticGet('uri', $feedurl);
+$sub = FeedSub::getKV('uri', $feedurl);
 if (!$sub) {
     print "Feed $feedurl is not subscribed.\n";
     exit(1);
@@ -69,7 +69,7 @@ if ($ok) {
     print "Could not confirm.\n";
 }
 
-$sub2 = FeedSub::staticGet('uri', $feedurl);
+$sub2 = FeedSub::getKV('uri', $feedurl);
 
 print "\n";
 print "New state:\n";
index 149bcc343ffb13daf8c65fb3e740f37febef96d0..42f21a7aa0465e41439db0a6212f5c1a34bda67d 100644 (file)
@@ -45,7 +45,7 @@ $skip = have_option('skip') ? intval(get_option_value('skip')) : 0;
 $count = have_option('count') ? intval(get_option_value('count')) : 0;
 
 
-$sub = FeedSub::staticGet('uri', $feedurl);
+$sub = FeedSub::getKV('uri', $feedurl);
 if (!$sub) {
     print "Feed $feedurl is not subscribed.\n";
     exit(1);
index 20f6d57d9001d5ba5f9d879dda93cb8ceb00e033..bca71b6258f2eb63a79d22276d61fa198614a206 100644 (file)
@@ -51,7 +51,7 @@ function showProfileInfo($oprofile) {
 }
 
 function fixProfile($uri) {
-    $oprofile = Ostatus_profile::staticGet('uri', $uri);
+    $oprofile = Ostatus_profile::getKV('uri', $uri);
 
     if (!$oprofile) {
         print "No OStatus remote profile known for URI $uri\n";
index 64afa0f3568821849bc505ed8d8a79872e2b518b..ff6a149c604c4afee29af0cba7a573b293ed9229 100644 (file)
@@ -40,7 +40,7 @@ if (empty($args[0]) || !Validate::uri($args[0])) {
 $uri = $args[0];
 
 
-$oprofile = Ostatus_profile::staticGet('uri', $uri);
+$oprofile = Ostatus_profile::getKV('uri', $uri);
 
 if (!$oprofile) {
     print "No OStatus remote profile known for URI $uri\n";
@@ -114,7 +114,7 @@ if ($ok) {
     print "Could not confirm.\n";
 }
 
-$o2 = Ostatus_profile::staticGet('uri', $uri);
+$o2 = Ostatus_profile::getKV('uri', $uri);
 
 print "\n";
 print "New profile state:\n";
index 052cca1467af59e2df1d4f712ecc8ea696be34b7..5461eebe7db83be951e18b3272d4328806beb721 100644 (file)
@@ -40,14 +40,14 @@ try {
 
     if (have_option('i', 'id')) {
         $id = get_option_value('i', 'id');
-        $user = User::staticGet('id', $id);
+        $user = User::getKV('id', $id);
         if (empty($user)) {
             throw new Exception("Can't find user with id '$id'.");
         }
         updateOStatus($user);
     } else if (have_option('n', 'nickname')) {
         $nickname = get_option_value('n', 'nickname');
-        $user = User::staticGet('nickname', $nickname);
+        $user = User::getKV('nickname', $nickname);
         if (empty($user)) {
             throw new Exception("Can't find user with nickname '$nickname'.");
         }
@@ -86,7 +86,7 @@ function updateOStatus($user)
     $rps = array();
 
     while ($sp->fetch()) {
-        $remote = Remote_profile::staticGet('id', $sp->id);
+        $remote = Remote_profile::getKV('id', $sp->id);
 
         if (!empty($remote)) {
             $rps[] = clone($sp);
index b5f9d3e073ae90847c70f22c3abb65ca2a8fe049..e1670bb33658f4ed5dd8b3c3e2ad1209f72b8c13 100644 (file)
@@ -43,7 +43,7 @@ if (!have_option('--notice')) {
 
 $notice_id = get_option_value('--notice');
 
-$notice = Notice::staticGet('id', $notice_id);
+$notice = Notice::getKV('id', $notice_id);
 $profile = $notice->getProfile();
 $entry = $notice->asAtomEntry(true);
 
index 2de6c9a6671afd408dfcaf79896002362520f6a0..ba95912b3bb822bda0e83adf9f383e1c3c2810d3 100644 (file)
@@ -56,7 +56,7 @@ class OfflineBackupQueueHandler extends QueueHandler
     {
         $userId = $object;
 
-        $user = User::staticGet($userId);
+        $user = User::getKV($userId);
 
         common_log(LOG_INFO, "Making backup file for user ".$user->nickname);
 
index 3d8dab8213c30f94d11889ae5090ad1e4924029b..3dfcf6c68acbb97a296c195baae1b2263e950c15 100644 (file)
@@ -827,7 +827,7 @@ class OpenIDPlugin extends Plugin
     
     function onOtherAccountProfiles($profile, &$links)
     {
-        $prefs = User_openid_prefs::staticGet('user_id', $profile->id);
+        $prefs = User_openid_prefs::getKV('user_id', $profile->id);
 
         if (empty($prefs) || !$prefs->hide_profile_link) {
 
index 0d3f0fcb765ab2efc5581bc9690a7d1ced6b2a45..4326f1951461a954017aebcb30dceb7ca3a6b78e 100644 (file)
@@ -222,7 +222,7 @@ class FinishopenidloginAction extends Action
         if (common_config('site', 'inviteonly')) {
             $code = $_SESSION['invitecode'];
             if ($code) {
-                $invite = Invitation::staticGet($code);
+                $invite = Invitation::getKV($code);
 
                 if ($invite && $invite->address_type == 'email') {
                     return $invite->address;
@@ -335,7 +335,7 @@ class FinishopenidloginAction extends Action
                 return;
             }
 
-            $invite = Invitation::staticGet($code);
+            $invite = Invitation::getKV($code);
 
             if (empty($invite)) {
                 // TRANS: OpenID plugin message. No new user registration is allowed on the site without an invitation code, and the one provided was not valid.
@@ -357,7 +357,7 @@ class FinishopenidloginAction extends Action
             return;
         }
 
-        if (User::staticGet('nickname', $nickname)) {
+        if (User::getKV('nickname', $nickname)) {
             // TRANS: OpenID plugin message. The entered new user name is already used.
             $this->showForm(_m('Nickname already in use. Try another one.'));
             return;
@@ -447,7 +447,7 @@ class FinishopenidloginAction extends Action
 
         // They're legit!
 
-        $user = User::staticGet('nickname', $nickname);
+        $user = User::getKV('nickname', $nickname);
 
         list($display, $canonical, $sreg) = $this->getSavedValues();
 
@@ -536,7 +536,7 @@ class FinishopenidloginAction extends Action
         if (!User::allowed_nickname($str)) {
             return false;
         }
-        if (User::staticGet('nickname', $str)) {
+        if (User::getKV('nickname', $str)) {
             return false;
         }
         return true;
index 49dd53c8781e0b50080737827103fe02f72ab7e7..c38b646dc56e5edeb477b90b5aa01e65cc27712e 100644 (file)
@@ -102,9 +102,9 @@ function oid_link_user($id, $canonical, $display)
 function oid_get_user($openid_url)
 {
     $user = null;
-    $oid = User_openid::staticGet('canonical', $openid_url);
+    $oid = User_openid::getKV('canonical', $openid_url);
     if ($oid) {
-        $user = User::staticGet('id', $oid->user_id);
+        $user = User::getKV('id', $oid->user_id);
     }
     return $user;
 }
index 0dc4930ce1b8931841207c5d0b94806f4ca5313c..7bef69bccd85e12088fd5536dc2e2985d7ad7d4e 100644 (file)
@@ -223,7 +223,7 @@ class OpenidsettingsAction extends SettingsAction
                                       'value' => _m('BUTTON','Remove')));
         $this->elementEnd('fieldset');
         
-        $prefs = User_openid_prefs::staticGet('user_id', $user->id);
+        $prefs = User_openid_prefs::getKV('user_id', $user->id);
 
         $this->elementStart('fieldset');
         $this->element('legend', null, _m('LEGEND','Preferences'));
@@ -326,7 +326,7 @@ class OpenidsettingsAction extends SettingsAction
     {
         $openid_url = $this->trimmed('openid_url');
 
-        $oid = User_openid::staticGet('canonical', $openid_url);
+        $oid = User_openid::getKV('canonical', $openid_url);
 
         if (!$oid) {
             // TRANS: Form validation error for a non-existing OpenID.
@@ -362,7 +362,7 @@ class OpenidsettingsAction extends SettingsAction
         }
 
         $orig  = null;
-        $prefs = User_openid_prefs::staticGet('user_id', $cur->id);
+        $prefs = User_openid_prefs::getKV('user_id', $cur->id);
 
         if (empty($prefs)) {
             $prefs          = new User_openid_prefs();
index 41740f9a45ca01c8c8bb866b50a6ccf5af7d2203..6cc38f7435dd2ed148b221fc44fc97cc1fb04505 100644 (file)
@@ -101,7 +101,7 @@ class Poll extends Managed_DataObject
      */
     static function getByNotice($notice)
     {
-        return self::staticGet('uri', $notice->uri);
+        return self::getKV('uri', $notice->uri);
     }
 
     function getOptions()
@@ -128,7 +128,7 @@ class Poll extends Managed_DataObject
 
     function getNotice()
     {
-        return Notice::staticGet('uri', $this->uri);
+        return Notice::getKV('uri', $this->uri);
     }
 
     function bestUrl()
index 1fadcf108c386885b5c6273d58b9327a80eda9d5..d09d827bd1f5be281a4e0eb96333c041683ef430 100644 (file)
@@ -235,7 +235,7 @@ class PollPlugin extends MicroAppPlugin
                     // TRANS: Exception thrown trying to respond to a poll without a poll reference.
                     throw new Exception(_m('Invalid poll response: No poll reference.'));
                 }
-                $poll = Poll::staticGet('uri', $pollUri);
+                $poll = Poll::getKV('uri', $pollUri);
                 if (!$poll) {
                     // TRANS: Exception thrown trying to respond to a non-existing poll.
                     throw new Exception(_m('Invalid poll response: Poll is unknown.'));
@@ -503,9 +503,9 @@ class PollPlugin extends MicroAppPlugin
     function onEndNoticeWhoGets($notice, &$ni) {
         if ($notice->object_type == self::POLL_RESPONSE_OBJECT) {
             foreach ($ni as $id => $source) {
-                $user = User::staticGet('id', $id);
+                $user = User::getKV('id', $id);
                 if (!empty($user)) {
-                    $pollPrefs = User_poll_prefs::staticGet('user_id', $user->id);
+                    $pollPrefs = User_poll_prefs::getKV('user_id', $user->id);
                     if (!empty($pollPrefs) && ($pollPrefs->hide_responses)) {
                         unset($ni[$id]);
                     }
index b466e9f592ac84ac3a3b82986e12facafed480ca..ab1524c6916afdb270cfd038ce487b7ef7d30ca0 100644 (file)
@@ -104,7 +104,7 @@ class Poll_response extends Managed_DataObject
      */
     static function getByNotice($notice)
     {
-        return self::staticGet('uri', $notice->uri);
+        return self::getKV('uri', $notice->uri);
     }
 
     /**
@@ -114,7 +114,7 @@ class Poll_response extends Managed_DataObject
      */
     function getNotice()
     {
-        return Notice::staticGet('uri', $this->uri);
+        return Notice::getKV('uri', $this->uri);
     }
 
     function bestUrl()
@@ -128,7 +128,7 @@ class Poll_response extends Managed_DataObject
      */
     function getPoll()
     {
-        return Poll::staticGet('id', $this->poll_id);
+        return Poll::getKV('id', $this->poll_id);
     }
     /**
      * Save a new poll notice
index c3128895cffa3a03dd479ff536f69247468577f5..b390812cf41a4c4a812f583af164b8da7ce3a481 100644 (file)
@@ -65,7 +65,7 @@ class PollSettingsAction extends SettingsAction
     {
         $user = common_current_user();
 
-        $prefs = User_poll_prefs::staticGet('user_id', $user->id);
+        $prefs = User_poll_prefs::getKV('user_id', $user->id);
 
         $form = new PollPrefsForm($this, $prefs);
 
@@ -84,7 +84,7 @@ class PollSettingsAction extends SettingsAction
     {
         $user = common_current_user();
 
-        $upp = User_poll_prefs::staticGet('user_id', $user->id);
+        $upp = User_poll_prefs::getKV('user_id', $user->id);
         $orig = null;
 
         if (!empty($upp)) {
index 27b9b193fe4ae288ad91c81615fbfd192334e083..df3f68e87c63511f6f94b7a4e9d223eaf37dd7d3 100644 (file)
@@ -90,7 +90,7 @@ class RespondPollAction extends Action
         }
 
         $id = $this->trimmed('id');
-        $this->poll = Poll::staticGet('id', $id);
+        $this->poll = Poll::getKV('id', $id);
         if (empty($this->poll)) {
             // TRANS: Client exception thrown trying to respond to a non-existing poll.
             throw new ClientException(_m('Invalid or missing poll.'), 404);
index edfe3fe245f8520105184c231a43ec2e40a2873d..91f661edd26e1b896d8b93a3c0c237f2c6a25c8b 100644 (file)
@@ -52,7 +52,7 @@ class ShowPollAction extends ShownoticeAction
     {
         $this->id = $this->trimmed('id');
 
-        $this->poll = Poll::staticGet('id', $this->id);
+        $this->poll = Poll::getKV('id', $this->id);
 
         if (empty($this->poll)) {
             // TRANS: Client exception thrown trying to view a non-existing poll.
index 4908e93dd0e250caa7326e4911b2a67fcb937d92..ce9353638849aeff74c7f735aa698bf6f494e5f8 100644 (file)
@@ -225,7 +225,7 @@ class QnAPlugin extends MicroAppPlugin
             );
             break;
         case Answer::ObjectType:
-            $question = QnA_Question::staticGet('uri', $questionObj->id);
+            $question = QnA_Question::getKV('uri', $questionObj->id);
             if (empty($question)) {
                 // FIXME: save the question
                 // TRANS: Exception thrown when answering a non-existing question.
@@ -308,7 +308,7 @@ class QnAPlugin extends MicroAppPlugin
                 $class .= ' limited-scope';
             }
 
-            $question = QnA_Question::staticGet('uri', $nli->notice->uri);
+            $question = QnA_Question::getKV('uri', $nli->notice->uri);
 
             if (!empty($question->closed)) {
                 $class .= ' closed';
@@ -328,7 +328,7 @@ class QnAPlugin extends MicroAppPlugin
 
             $cls = array('hentry', 'notice', 'answer');
 
-            $answer = QnA_Answer::staticGet('uri', $nli->notice->uri);
+            $answer = QnA_Answer::getKV('uri', $nli->notice->uri);
 
             if (!empty($answer) && !empty($answer->best)) {
                 $cls[] = 'best';
index 1ef5063a025741046493b0f4ee948e9d9cbf6f8a..87a848987ceb3d36438a5e08d2abb79f1dc1a551 100644 (file)
@@ -92,7 +92,7 @@ class QnaclosequestionAction extends Action
         }
 
         $id = substr($this->trimmed('id'), 9);
-        $this->question = QnA_Question::staticGet('id', $id);
+        $this->question = QnA_Question::getKV('id', $id);
         if (empty($this->question)) {
             // TRANS: Client exception thrown trying to respond to a non-existing question.
             throw new ClientException(_m('Invalid or missing question.'), 404);
index e565b3e93ade336e0e559ad875f61cdcd820478e..661cbcc328a9dae4a103e9e1d46bf8cdb815545c 100644 (file)
@@ -93,7 +93,7 @@ class QnanewanswerAction extends Action
 
         $id = substr($this->trimmed('id'), 9);
 
-        $this->question = QnA_Question::staticGet('id', $id);
+        $this->question = QnA_Question::getKV('id', $id);
 
         if (empty($this->question)) {
             throw new ClientException(
index ce4bdea56ac5bcdb36799a7625ac17c65be96956..707a81f8ac6b21c29f05c4d4ebc7c462a6ef8a0a 100644 (file)
@@ -88,7 +88,7 @@ class QnareviseanswerAction extends Action
 
         $id = substr($this->trimmed('id'), 7);
 
-        $this->answer   = QnA_Answer::staticGet('id', $id);
+        $this->answer   = QnA_Answer::getKV('id', $id);
         $this->question = $this->answer->getQuestion();
 
         if (empty($this->answer) || empty($this->question)) {
index 85b39d0053bda45a64c534c648978950ed3c215f..95a3c595df80a9727acab6840a6d04ed6b49d79b 100644 (file)
@@ -61,7 +61,7 @@ class QnashowanswerAction extends ShownoticeAction
 
         $this->id = $this->trimmed('id');
 
-        $this->answer = QnA_Answer::staticGet('id', $this->id);
+        $this->answer = QnA_Answer::getKV('id', $this->id);
 
         if (empty($this->answer)) {
             // TRANS: Client exception thrown when requesting a non-existing answer.
@@ -75,14 +75,14 @@ class QnashowanswerAction extends ShownoticeAction
             throw new ClientException(_m('No question for this answer.'), 404);
         }
 
-        $this->notice = Notice::staticGet('uri', $this->answer->uri);
+        $this->notice = Notice::getKV('uri', $this->answer->uri);
 
         if (empty($this->notice)) {
             // TRANS: Did we used to have it, and it got deleted?
             throw new ClientException(_m('No such answer.'), 404);
         }
 
-        $this->user = User::staticGet('id', $this->answer->profile_id);
+        $this->user = User::getKV('id', $this->answer->profile_id);
 
         if (empty($this->user)) {
             // TRANS: Client exception thrown when requesting answer data for a non-existing user.
index ca2cb74ba1d751c2279b4c5db7007a39f154b02d..f030efadb2b28fba620457dfda5e135f47d09696 100644 (file)
@@ -61,7 +61,7 @@ class QnashowquestionAction extends ShownoticeAction
 
         $this->id = $this->trimmed('id');
 
-        $this->question = QnA_Question::staticGet('id', $this->id);
+        $this->question = QnA_Question::getKV('id', $this->id);
 
         if (empty($this->question)) {
             // TRANS: Client exception thrown trying to view a non-existing question.
@@ -76,7 +76,7 @@ class QnashowquestionAction extends ShownoticeAction
             throw new ClientException(_m('No such question notice.'), 404);
         }
 
-        $this->user = User::staticGet('id', $this->question->profile_id);
+        $this->user = User::getKV('id', $this->question->profile_id);
 
         if (empty($this->user)) {
             // TRANS: Client exception thrown trying to view a question of a non-existing user.
index 715f81e831f979f3e99b6fd07ed414cb5b4dffc7..df4898dfe9806fa7bdaf61c31c6703e66494cf0b 100644 (file)
@@ -90,7 +90,7 @@ class Qnavote extends Action
         }
 
         $id = $this->trimmed('id');
-        $this->question = QnA_Question::staticGet('id', $id);
+        $this->question = QnA_Question::getKV('id', $id);
         if (empty($this->question)) {
             // TRANS: Client exception thrown trying to respond to a non-existing question.
             throw new ClientException(_m('Invalid or missing question.'), 404);
index 5cbc80594c9f0007d02d131386da1cd26ad3c740..96796b80e226094ddd963fce42d61ba1fe1c4be0 100644 (file)
@@ -122,7 +122,7 @@ class QnA_Answer extends Managed_DataObject
      */
     static function getByNotice($notice)
     {
-        $answer = self::staticGet('uri', $notice->uri);
+        $answer = self::getKV('uri', $notice->uri);
         if (empty($answer)) {
             throw new Exception("No answer with URI {$notice->uri}");
         }
@@ -136,12 +136,12 @@ class QnA_Answer extends Managed_DataObject
      */
     function getNotice()
     {
-        return Notice::staticGet('uri', $this->uri);
+        return Notice::getKV('uri', $this->uri);
     }
 
     static function fromNotice($notice)
     {
-        return QnA_Answer::staticGet('uri', $notice->uri);
+        return QnA_Answer::getKV('uri', $notice->uri);
     }
 
     function bestUrl()
@@ -156,7 +156,7 @@ class QnA_Answer extends Managed_DataObject
      */
     function getQuestion()
     {
-        $question = QnA_Question::staticGet('id', $this->question_id);
+        $question = QnA_Question::getKV('id', $this->question_id);
         if (empty($question)) {
             // TRANS: Exception thown when getting a question with a non-existing ID.
             // TRANS: %s is the non-existing question ID.
@@ -167,7 +167,7 @@ class QnA_Answer extends Managed_DataObject
 
     function getProfile()
     {
-        $profile = Profile::staticGet('id', $this->profile_id);
+        $profile = Profile::getKV('id', $this->profile_id);
         if (empty($profile)) {
             // TRANS: Exception thown when getting a profile with a non-existing ID.
             // TRANS: %s is the non-existing profile ID.
index a029a2434a22400ce0a7c4886b6cc62fb2bbc39f..58a9cd5e183fd24fc25523f6ba002c7dfd94d794 100644 (file)
@@ -116,12 +116,12 @@ class QnA_Question extends Managed_DataObject
      */
     static function getByNotice($notice)
     {
-        return self::staticGet('uri', $notice->uri);
+        return self::getKV('uri', $notice->uri);
     }
 
     function getNotice()
     {
-        return Notice::staticGet('uri', $this->uri);
+        return Notice::getKV('uri', $this->uri);
     }
 
     function bestUrl()
@@ -131,7 +131,7 @@ class QnA_Question extends Managed_DataObject
 
     function getProfile()
     {
-        $profile = Profile::staticGet('id', $this->profile_id);
+        $profile = Profile::getKV('id', $this->profile_id);
         if (empty($profile)) {
             // TRANS: Exception trown when getting a profile for a non-existing ID.
             // TRANS: %s is the provided profile ID.
@@ -183,7 +183,7 @@ class QnA_Question extends Managed_DataObject
 
     static function fromNotice($notice)
     {
-        return QnA_Question::staticGet('uri', $notice->uri);
+        return QnA_Question::getKV('uri', $notice->uri);
     }
 
     function asHTML()
index b7954884ddb61fd6d1bbaa9494568b340e71b7e9..7fd6da05098bc401f9073812ca372dbcd6f0df76 100644 (file)
@@ -269,7 +269,7 @@ class RSSCloudRequestNotifyAction extends Action
         $valid = '%^' . $path . '(?<id>.*)\.rss$%';
 
         if (preg_match($valid, $feed, $matches)) {
-            $user = User::staticGet('id', $matches['id']);
+            $user = User::getKV('id', $matches['id']);
             if (!empty($user)) {
                 return $user;
             }
index 595af884468ac4aad7d441fe6dff8fd22dc25a96..e5acb9da24a6d7c5f090493489aa146e88e886f5 100644 (file)
@@ -36,7 +36,7 @@ class RSSCloudSubscription extends Memcached_DataObject {
     var $created;                         // datestamp()
     var $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
 
-    function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('DataObjects_Grp',$k,$v); }
+    static function getKV($k,$v=NULL) { return DB_DataObject::staticGet('DataObjects_Grp',$k,$v); }
 
     function table()
     {
index 0fa51ce8612372eac33e2c34fa3010932f8bc9b8..aec53d48f33385aa7a60d0520dcc898664a04900 100644 (file)
@@ -179,7 +179,7 @@ class RealtimePlugin extends Plugin
             return true;
         }
 
-        $user = User::staticGet('id', $notice->profile_id);
+        $user = User::getKV('id', $notice->profile_id);
 
         if (!empty($user)) {
             $paths[] = array('showstream', $user->nickname, null);
@@ -208,7 +208,7 @@ class RealtimePlugin extends Plugin
         $ni = $notice->whoGets();
 
         foreach (array_keys($ni) as $user_id) {
-            $user = User::staticGet('id', $user_id);
+            $user = User::getKV('id', $user_id);
             $paths[] = array('all', $user->nickname, null);
         }
 
@@ -219,7 +219,7 @@ class RealtimePlugin extends Plugin
 
         if ($reply->find()) {
             while ($reply->fetch()) {
-                $user = User::staticGet('id', $reply->profile_id);
+                $user = User::getKV('id', $reply->profile_id);
                 if (!empty($user)) {
                     $paths[] = array('replies', $user->nickname, null);
                 }
@@ -234,7 +234,7 @@ class RealtimePlugin extends Plugin
 
         if ($gi->find()) {
             while ($gi->fetch()) {
-                $ug = User_group::staticGet('id', $gi->group_id);
+                $ug = User_group::getKV('id', $gi->group_id);
                 $paths[] = array('showgroup', $ug->nickname, null);
             }
         }
@@ -265,7 +265,7 @@ class RealtimePlugin extends Plugin
                     if (is_null($channel->user_id)) {
                         $profile = null;
                     } else {
-                        $profile = Profile::staticGet('id', $channel->user_id);
+                        $profile = Profile::getKV('id', $channel->user_id);
                     }
                     if ($notice->inScope($profile)) {
                         $this->log(LOG_INFO, 
@@ -345,7 +345,7 @@ class RealtimePlugin extends Plugin
         // Add needed repeat data
 
         if (!empty($notice->repeat_of)) {
-            $original = Notice::staticGet('id', $notice->repeat_of);
+            $original = Notice::getKV('id', $notice->repeat_of);
             if (!empty($original)) {
                 $arr['retweeted_status']['url'] = $original->bestUrl();
                 $arr['retweeted_status']['html'] = htmlspecialchars($original->rendered);
@@ -385,7 +385,7 @@ class RealtimePlugin extends Plugin
         $convurl = null;
 
         if ($notice->hasConversation()) {
-            $conv = Conversation::staticGet(
+            $conv = Conversation::getKV(
                 'id',
                 $notice->conversation
             );
index 1c10bc69e8965b5941a8062d22f814fbb8f3ea21..ea195b02cddccb7b113f82f31329e9247ae54696 100644 (file)
@@ -48,7 +48,7 @@ function cleanupChannels()
         $keys = $rc->fetchAll();
 
         foreach ($keys as $key) {
-            $rc = Realtime_channel::staticGet('channel_key', $key);
+            $rc = Realtime_channel::getKV('channel_key', $key);
             if (!empty($rc)) {
                 printfv("Deleting realtime channel '$key'\n");
                 $rc->delete();
index 4c4e5de1cc985d33ed919ccc3f2c45119d8dbb0c..ee092ce2bc45e38674d47409b1d447397d2dac7c 100644 (file)
@@ -72,7 +72,7 @@ class ClosechannelAction extends Action
             throw new ClientException(_m('No channel key argument.'));
         }
 
-        $this->channel = Realtime_channel::staticGet('channel_key', $this->channelKey);
+        $this->channel = Realtime_channel::getKV('channel_key', $this->channelKey);
 
         if (empty($this->channel)) {
             // TRANS: Client exception thrown when referring to a non-existing channel.
index 7559927d6b8a1d5b79c61c0e4f1f03d58efc1c8e..e9319ed916e5b99899e8b27a7477f10939a618bf 100644 (file)
@@ -72,7 +72,7 @@ class KeepalivechannelAction extends Action
             throw new ClientException(_m('No channel key argument.'));
         }
 
-        $this->channel = Realtime_channel::staticGet('channel_key', $this->channelKey);
+        $this->channel = Realtime_channel::getKV('channel_key', $this->channelKey);
 
         if (empty($this->channel)) {
             // TRANS: Client exception thrown when referring to a non-existing channel.
index 1e686bd62bc70f077a0892324faed1ffe0b97f7b..93d990ca77820109a481b198fd3117e144275f60 100644 (file)
@@ -151,7 +151,7 @@ class RegisterThrottlePlugin extends Plugin
         if ($this->silenced) {
             $ids = Registration_ip::usersByIP($ipaddress);
             foreach ($ids as $id) {
-                $profile = Profile::staticGet('id', $id);
+                $profile = Profile::getKV('id', $id);
                 if ($profile && $profile->isSilenced()) {
                     // TRANS: Exception thrown when attempting to register from an IP address from which silenced users have registered.
                     throw new Exception(_m('A banned user has registered from this address.'));
@@ -283,7 +283,7 @@ class RegisterThrottlePlugin extends Plugin
             return true;
         }
 
-        $ri = Registration_ip::staticGet('user_id', $profile->id);
+        $ri = Registration_ip::getKV('user_id', $profile->id);
 
         if (empty($ri)) {
             return true;
@@ -296,7 +296,7 @@ class RegisterThrottlePlugin extends Plugin
                 continue;
             }
 
-            $other = Profile::staticGet('id', $id);
+            $other = Profile::getKV('id', $id);
 
             if (empty($other)) {
                 continue;
index 0deba68579dd4f0e349ca248fdc1563a6a64b9f1..0a79796ebf1ae5b88ac7e37fdad55fc33391ced6 100644 (file)
@@ -111,7 +111,7 @@ class RequireValidatedEmailPlugin extends Plugin
      */
     function onStartNoticeSave($notice)
     {
-        $user = User::staticGet('id', $notice->profile_id);
+        $user = User::getKV('id', $notice->profile_id);
         if (!empty($user)) { // it's a remote notice
             if (!$this->validated($user)) {
                 // TRANS: Client exception thrown when trying to post notices before validating an e-mail address.
@@ -272,7 +272,7 @@ class RequireValidatedEmailPlugin extends Plugin
     {
         if ($right == Right::CREATEGROUP ||
             ($this->disallowLogin && ($right == Right::WEBLOGIN || $right == Right::API))) {
-            $user = User::staticGet('id', $profile->id);
+            $user = User::getKV('id', $profile->id);
             if ($user && !$this->validated($user)) {
                 $result = false;
                 return false;
index 0b6843fa470b913595af3f4bcaa56e7a761620a1..0019d1c6be90303aa020187b1c5741043b31a2b9 100644 (file)
@@ -70,7 +70,7 @@ class ConfirmfirstemailAction extends Action
 
         $this->code = $this->trimmed('code');
 
-        $this->confirm = Confirm_address::staticGet('code', $this->code);
+        $this->confirm = Confirm_address::getKV('code', $this->code);
 
         if (empty($this->confirm)) {
             // TRANS: Client exception thrown when trying to register with a non-existing confirmation code.
@@ -78,7 +78,7 @@ class ConfirmfirstemailAction extends Action
             return;
         }
 
-        $this->user = User::staticGet('id', $this->confirm->user_id);
+        $this->user = User::getKV('id', $this->confirm->user_id);
 
         if (empty($this->user)) {
             // TRANS: Client exception thrown when trying to register with a confirmation code that is not connected with a user.
index 59c229b6847ce307ece7181328ce302eefa229dc..4d2000ab0fe714903549880f040c1f97dc77cad0 100644 (file)
@@ -37,7 +37,7 @@ $email = get_option_value('e', 'email');
 $parts = explode('@', $email);
 $nickname = common_nicknamize($parts[0]);
 
-$user = User::staticGet('nickname', $nickname);
+$user = User::getKV('nickname', $nickname);
 
 if (!empty($user)) {
     $confirm = new Confirm_address();
index 6c7bcf4911d31f56e6050b151c2457990adc30e0..415f710440a509485a9f6dc415c06b5333f537e6 100644 (file)
@@ -130,7 +130,7 @@ class User_greeting_count extends Managed_DataObject
      */
     static function inc($user_id)
     {
-        $gc = User_greeting_count::staticGet('user_id', $user_id);
+        $gc = User_greeting_count::getKV('user_id', $user_id);
 
         if (empty($gc)) {
             $gc = new User_greeting_count();
index cb42edcbf6ecc62c1efd64371c4715a1445aeb30..46ae65c8388a909df1269c250419cecffe4fb8d8 100644 (file)
@@ -211,7 +211,7 @@ class Sitemap_notice_count extends Managed_DataObject
 
     static function updateCount($d, $n)
     {
-        $snc = Sitemap_notice_count::staticGet('notice_date', DB_DataObject_Cast::date($d));
+        $snc = Sitemap_notice_count::getKV('notice_date', DB_DataObject_Cast::date($d));
 
         if (empty($snc)) {
             // TRANS: Exception
index 3377879f9479d6a01df8a7ad51a943817acafdc2..c085e4de9e26ecf3f52d0c0549ff7384636426dc 100644 (file)
@@ -212,7 +212,7 @@ class Sitemap_user_count extends Managed_DataObject
 
     static function updateCount($d, $n)
     {
-        $suc = Sitemap_user_count::staticGet('registration_date', DB_DataObject_Cast::date($d));
+        $suc = Sitemap_user_count::getKV('registration_date', DB_DataObject_Cast::date($d));
 
         if (empty($suc)) {
             // TRANS: Exception thrown when a registration date cannot be found.
index 9c8a9f53fb160f8016746efc56998db0ab97e2d8..5c9fb31f8f97a790364d872a996b2a11e13bba27 100644 (file)
@@ -143,7 +143,7 @@ class FavoritedSliceAction extends FavoritedAction
         $ids = array();
         foreach ($nicks as $nick) {
             // not the most efficient way for a big list!
-            $user = User::staticGet('nickname', $nick);
+            $user = User::getKV('nickname', $nick);
             if ($user) {
                 $ids[] = intval($user->id);
             }
index e3b67bb1d6a310ef7193721acb892a00f19ba3b4..e6bbaf68642c8cc6779d269712ee7ad3fa826bc3 100644 (file)
@@ -77,7 +77,7 @@ abstract class BaseMirrorAction extends Action
     protected function validateProfile($id)
     {
         $id = intval($id);
-        $profile = Profile::staticGet('id', $id);
+        $profile = Profile::getKV('id', $id);
         if ($profile && $profile->id != $this->user->id) {
             return $profile;
         }
index 557eb0aba47d3ba123c69830b45a483c9edb9450..1119e8718f23182c0395b9540ffbd6d1d672b572 100644 (file)
@@ -98,7 +98,7 @@ class EditMirrorAction extends BaseMirrorAction
 
         if ($this->delete) {
             $mirror->delete();
-            $oprofile = Ostatus_profile::staticGet('profile_id', $this->profile->id);
+            $oprofile = Ostatus_profile::getKV('profile_id', $this->profile->id);
             if ($oprofile) {
                 $oprofile->garbageCollect();
             }
index 000d7ecad09c5045b64becd795a76404264e4518..272698abc37d2f3b04c44bbada59609d0b9c78f7 100644 (file)
@@ -91,7 +91,7 @@ class MirrorSettingsAction extends SettingsAction
 
     function showFeedForm($mirror)
     {
-        $profile = Profile::staticGet('id', $mirror->subscribed);
+        $profile = Profile::getKV('id', $mirror->subscribed);
         if ($profile) {
             $form = new EditMirrorForm($this, $profile);
             $form->show();
index f7c8c567c2c139c4c475312bc3d4de14ff0448ff..ac1eb01f60bd1d230afd38ada5171b19e01991fc 100644 (file)
@@ -150,7 +150,7 @@ class SubMirror extends Managed_DataObject
      */
     public function mirrorNotice($notice)
     {
-        $profile = Profile::staticGet('id', $this->subscriber);
+        $profile = Profile::getKV('id', $this->subscriber);
         if (!$profile) {
             common_log(LOG_ERR, "SubMirror plugin skipping auto-repeat of notice $notice->id for missing user $profile->id");
             return false;
index c09aa4a7ad70429c95a1945155873a324af2b26f..1fc13e8212059f78732658a27f44aa6078cbb706 100644 (file)
@@ -144,7 +144,7 @@ class EditMirrorForm extends Form
     {
         // Ok this is a bit of a hack. ;)
         if (class_exists('Ostatus_profile')) {
-            $oprofile = Ostatus_profile::staticGet('profile_id', $profile->id);
+            $oprofile = Ostatus_profile::getKV('profile_id', $profile->id);
             if ($oprofile) {
                 return $oprofile->feeduri;
             }
index f2756060e94e2c4ec33556e829fe5e38d850db9b..80656ad833fc4a17d6bc2464ff803689431e185d 100644 (file)
@@ -135,7 +135,7 @@ class Notice_to_status extends Managed_DataObject
         if (empty($notice_id)) {
             throw new Exception("Invalid notice_id $notice_id");
         }
-        $n2s = Notice_to_status::staticGet('notice_id', $notice_id);
+        $n2s = Notice_to_status::getKV('notice_id', $notice_id);
 
         if (!empty($n2s)) {
             return $n2s;
@@ -144,7 +144,7 @@ class Notice_to_status extends Managed_DataObject
         if (empty($status_id)) {
             throw new Exception("Invalid status_id $status_id");
         }
-        $n2s = Notice_to_status::staticGet('status_id', $status_id);
+        $n2s = Notice_to_status::getKV('status_id', $status_id);
 
         if (!empty($n2s)) {
             return $n2s;
index 672c1b84510f871c0a1581b67a697bbc14007b93..6dc8ae8b76545eba81db84ad958de72ee37534ca 100644 (file)
@@ -441,7 +441,7 @@ class TwitterBridgePlugin extends Plugin
      */
     function onStartDeleteOwnNotice(User $user, Notice $notice)
     {
-        $n2s = Notice_to_status::staticGet('notice_id', $notice->id);
+        $n2s = Notice_to_status::getKV('notice_id', $notice->id);
 
         if (!empty($n2s)) {
 
index 38a8b89ebb815acbd6147bba088f242c58a63dc2..b20d8691a3ba2d20a6112e30f325eecab5eeb47d 100755 (executable)
@@ -228,7 +228,7 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
 
                 // Get associated user and subscribe her
 
-                $friend_user = User::staticGet('id', $friend_flink->user_id);
+                $friend_user = User::getKV('id', $friend_flink->user_id);
 
                 if (!empty($friend_user)) {
                     $result = subs_subscribe_to($user, $friend_user);
index 369688816229ac1d86eafc89c88cf747d4f75669..e827a07117ca7b44623c0db3875c323cfc3341f3 100644 (file)
@@ -109,13 +109,13 @@ if (have_option('all')) {
         }
     }
 } else {
-    $user = User::staticGet('nickname', $nickname);
+    $user = User::getKV('nickname', $nickname);
     $users = array($user->id);
 }
 
 $output = array();
 foreach ($users as $id) {
-    $user = User::staticGet('id', $id);
+    $user = User::getKV('id', $id);
     if (!$user) {
         throw new Exception("No user for id $id");
     }
index aad15fdeab95a02c0a30851c73dc90dcd9ba267a..e0c48efe57c1c4a292f69a37432a4638c5c304f6 100644 (file)
@@ -113,7 +113,7 @@ function siteStreamForOwner(User $user)
 }
 
 
-$user = User::staticGet('nickname', $nickname);
+$user = User::getKV('nickname', $nickname);
 global $myuser;
 $myuser = $user;
 
index ac61cc6160d8f695a72cf4886c7a5937d8ffefc3..358c3aa86e036c7a1f83ecdb01f0265780c57adc 100644 (file)
@@ -132,7 +132,7 @@ function is_twitter_bound($notice, $flink) {
 
 function is_twitter_notice($id)
 {
-    $n2s = Notice_to_status::staticGet('notice_id', $id);
+    $n2s = Notice_to_status::getKV('notice_id', $id);
 
     return (!empty($n2s));
 }
@@ -184,7 +184,7 @@ function broadcast_twitter($notice)
     if (!empty($flink) && TwitterOAuthClient::isPackedToken($flink->credentials)) {
         if (is_twitter_bound($notice, $flink)) {
             if (!empty($notice->repeat_of) && is_twitter_notice($notice->repeat_of)) {
-                $retweet = retweet_notice($flink, Notice::staticGet('id', $notice->repeat_of));
+                $retweet = retweet_notice($flink, Notice::getKV('id', $notice->repeat_of));
                 if (is_object($retweet)) {
                     Notice_to_status::saveNew($notice->id, twitter_id($retweet));
                     return true;
@@ -239,7 +239,7 @@ function retweet_notice($flink, $notice)
 
 function twitter_status_id($notice)
 {
-    $n2s = Notice_to_status::staticGet('notice_id', $notice->id);
+    $n2s = Notice_to_status::getKV('notice_id', $notice->id);
     if (empty($n2s)) {
         return null;
     } else {
@@ -263,7 +263,7 @@ function twitter_update_params($notice)
         $params['long'] = $notice->lon;
     }
     if (!empty($notice->reply_to) && is_twitter_notice($notice->reply_to)) {
-        $reply = Notice::staticGet('id', $notice->reply_to);
+        $reply = Notice::getKV('id', $notice->reply_to);
         $params['in_reply_to_status_id'] = twitter_status_id($reply);
     }
     return $params;
index 1a7234214e132d5867d99f86988333cb1b8e9c7c..6a86c81cb724ea01092b9503b1e532a1dd3d08f2 100644 (file)
@@ -471,7 +471,7 @@ class TwitterauthorizationAction extends Action
         if (common_config('site', 'inviteonly')) {
             $code = $_SESSION['invitecode'];
             if ($code) {
-                $invite = Invitation::staticGet($code);
+                $invite = Invitation::getKV($code);
 
                 if ($invite && $invite->address_type == 'email') {
                     return $invite->address;
@@ -509,7 +509,7 @@ class TwitterauthorizationAction extends Action
                 return;
             }
 
-            $invite = Invitation::staticGet($code);
+            $invite = Invitation::getKV($code);
 
             if (empty($invite)) {
                 // TRANS: Client error displayed when trying to create a new user with an invalid invitation code.
@@ -531,7 +531,7 @@ class TwitterauthorizationAction extends Action
             return;
         }
 
-        if (User::staticGet('nickname', $nickname)) {
+        if (User::getKV('nickname', $nickname)) {
             // TRANS: Client error displayed when trying to create a new user with a username that is already in use.
             $this->showForm(_m('Nickname already in use. Try another one.'));
             return;
@@ -594,7 +594,7 @@ class TwitterauthorizationAction extends Action
             return;
         }
 
-        $user = User::staticGet('nickname', $nickname);
+        $user = User::getKV('nickname', $nickname);
 
         if (!empty($user)) {
             common_debug('TwitterBridge Plugin - ' .
@@ -715,7 +715,7 @@ class TwitterauthorizationAction extends Action
         if (!User::allowed_nickname($str)) {
             return false;
         }
-        if (User::staticGet('nickname', $str)) {
+        if (User::getKV('nickname', $str)) {
             return false;
         }
         return true;
index dc7277caf9168931fe519a075cc70306aa174065..cdfb8f8316b86686ee20b9be69cb02151c46d1c3 100644 (file)
@@ -90,7 +90,7 @@ class TwitterImport
         $statusUri = $this->makeStatusURI($status->user->screen_name, $statusId);
 
         // check to see if we've already imported the status
-        $n2s = Notice_to_status::staticGet('status_id', $statusId);
+        $n2s = Notice_to_status::getKV('status_id', $statusId);
 
         if (!empty($n2s)) {
             common_log(
@@ -98,7 +98,7 @@ class TwitterImport
                 $this->name() .
                 " - Ignoring duplicate import: {$statusId}"
             );
-            return Notice::staticGet('id', $n2s->notice_id);
+            return Notice::getKV('id', $n2s->notice_id);
         }
 
         // If it's a retweet, save it as a repeat!
@@ -149,11 +149,11 @@ class TwitterImport
         $replyTo = twitter_id($status, 'in_reply_to_status_id');
         if (!empty($replyTo)) {
             common_log(LOG_INFO, "Status {$statusId} is a reply to status {$replyTo}");
-            $n2s = Notice_to_status::staticGet('status_id', $replyTo);
+            $n2s = Notice_to_status::getKV('status_id', $replyTo);
             if (empty($n2s)) {
                 common_log(LOG_INFO, "Couldn't find local notice for status {$replyTo}");
             } else {
-                $reply = Notice::staticGet('id', $n2s->notice_id);
+                $reply = Notice::getKV('id', $n2s->notice_id);
                 if (empty($reply)) {
                     common_log(LOG_INFO, "Couldn't find local notice for status {$replyTo}");
                 } else {
@@ -215,7 +215,7 @@ class TwitterImport
 
 
     /**
-     * Look up a Profile by profileurl field.  Profile::staticGet() was
+     * Look up a Profile by profileurl field.  Profile::getKV() was
      * not working consistently.
      *
      * @param string $nickname   local nickname of the Twitter user
@@ -305,7 +305,7 @@ class TwitterImport
 
             // check for remote profile
 
-            $remote_pro = Remote_profile::staticGet('uri', $profileurl);
+            $remote_pro = Remote_profile::getKV('uri', $profileurl);
 
             if (empty($remote_pro)) {
                 $remote_pro = new Remote_profile();
@@ -440,7 +440,7 @@ class TwitterImport
 
         common_debug($this->name() . " - Updating avatar: $size");
 
-        $profile = Profile::staticGet($profile_id);
+        $profile = Profile::getKV($profile_id);
 
         if (empty($profile)) {
             common_debug($this->name() . " - Couldn't get profile: $profile_id!");
@@ -679,7 +679,7 @@ class TwitterImport
         foreach ($status->entities->user_mentions as $mention) {
             $flink = Foreign_link::getByForeignID($mention->id, TWITTER_SERVICE);
             if (!empty($flink)) {
-                $user = User::staticGet('id', $flink->user_id);
+                $user = User::getKV('id', $flink->user_id);
                 if (!empty($user)) {
                     $reply = new Reply();
                     $reply->notice_id  = $notice->id;
index d9e57cfc4b1a247d3446b733e0f292e1fdf4ccff..b7538c6663368b5c99b06d7d07ea28f4f391fd7d 100644 (file)
@@ -169,7 +169,7 @@ class AdminprofileflagAction extends Action
 
         if ($ufp->find()) {
             while ($ufp->fetch()) {
-                $profile = Profile::staticGet('id', $ufp->profile_id);
+                $profile = Profile::getKV('id', $ufp->profile_id);
                 if (!empty($profile)) {
                     $profiles[] = $profile;
                 }
@@ -354,7 +354,7 @@ class FlaggedProfileListItem extends ProfileListItem
 
         if ($ufp->find()) { // XXX: this should always happen
             while ($ufp->fetch()) {
-                $user = User::staticGet('id', $ufp->user_id);
+                $user = User::getKV('id', $ufp->user_id);
                 if (!empty($user)) { // XXX: this would also be unusual
                     $flaggers[] = clone($user);
                 }
index ffc88ab4739a980d3d1860c59699426102f114bc..f589753796384c3d7206a8462e890d35bc9b5f6d 100644 (file)
@@ -45,9 +45,9 @@ class YammerImporter
 
         $profileId = $this->findImportedUser($data['orig_id']);
         if ($profileId) {
-            return Profile::staticGet('id', $profileId);
+            return Profile::getKV('id', $profileId);
         } else {
-            $user = User::staticGet('nickname', $nickname);
+            $user = User::getKV('nickname', $nickname);
             if ($user) {
                 common_log(LOG_WARN, "Copying Yammer profile info onto existing user $nickname");
                 $profile = $user->getProfile();
@@ -82,12 +82,12 @@ class YammerImporter
 
         $groupId = $this->findImportedGroup($data['orig_id']);
         if ($groupId) {
-            return User_group::staticGet('id', $groupId);
+            return User_group::getKV('id', $groupId);
         } else {
-            $local = Local_group::staticGet('nickname', $nickname);
+            $local = Local_group::getKV('nickname', $nickname);
             if ($local) {
                 common_log(LOG_WARN, "Copying Yammer group info onto existing group $nickname");
-                $group = User_group::staticGet('id', $local->group_id);
+                $group = User_group::getKV('id', $local->group_id);
                 $this->savePropertiesOn($group, $data['options'],
                         array('fullname', 'description'));
             } else {
@@ -130,11 +130,11 @@ class YammerImporter
 
         $noticeId = $this->findImportedNotice($data['orig_id']);
         if ($noticeId) {
-            return Notice::staticGet('id', $noticeId);
+            return Notice::getKV('id', $noticeId);
         } else {
-            $notice = Notice::staticGet('uri', $data['options']['uri']);
+            $notice = Notice::getKV('uri', $data['options']['uri']);
             $content = $data['content'];
-            $user = User::staticGet($data['profile']);
+            $user = User::getKV($data['profile']);
 
             // Fetch file attachments and add the URLs...
             $uploads = array();
@@ -156,7 +156,7 @@ class YammerImporter
 
             // Save "likes" as favorites...
             foreach ($data['faves'] as $nickname) {
-                $user = User::staticGet('nickname', $nickname);
+                $user = User::getKV('nickname', $nickname);
                 if ($user) {
                     Fave::addNew($user->getProfile(), $notice);
                 }
@@ -331,7 +331,7 @@ class YammerImporter
                 $options['groups'] = array($groupId);
 
                 // @fixme if we see a group link inline, don't add this?
-                $group = User_group::staticGet('id', $groupId);
+                $group = User_group::getKV('id', $groupId);
                 if ($group) {
                     $content .= ' !' . $group->nickname;
                 }
@@ -365,19 +365,19 @@ class YammerImporter
 
     private function findImportedUser($origId)
     {
-        $map = Yammer_user::staticGet('id', $origId);
+        $map = Yammer_user::getKV('id', $origId);
         return $map ? $map->user_id : null;
     }
 
     private function findImportedGroup($origId)
     {
-        $map = Yammer_group::staticGet('id', $origId);
+        $map = Yammer_group::getKV('id', $origId);
         return $map ? $map->group_id : null;
     }
 
     private function findImportedNotice($origId)
     {
-        $map = Yammer_notice::staticGet('id', $origId);
+        $map = Yammer_notice::getKV('id', $origId);
         return $map ? $map->notice_id : null;
     }
 
index 04cc9c02837ddc4a70cf702424f41f45ed1b9dc2..5907ce0c326b6a9cac341ac071bc1e845a85f236 100644 (file)
@@ -40,7 +40,7 @@ class YammerRunner
      */
     public static function init()
     {
-        $state = Yammer_state::staticGet('id', 1);
+        $state = Yammer_state::getKV('id', 1);
         if (!$state) {
             $state = self::initState();
         }
@@ -302,7 +302,7 @@ class YammerRunner
             $this->state->state = 'save-messages';
         } else {
             foreach ($messages as $item) {
-                $stub = Yammer_notice_stub::staticGet($item['id']);
+                $stub = Yammer_notice_stub::getKV($item['id']);
                 if (!$stub) {
                     Yammer_notice_stub::record($item['id'], $item);
                 }
index 5ec53caf0e8fc38f0f0d8aa0311ea99fc624a0f5..a71ccb2d67834844888ded6be7c06fc1d812a58b 100755 (executable)
@@ -38,14 +38,14 @@ require_once INSTALLDIR.'/scripts/commandline.inc';
 
 if (have_option('i', 'id')) {
     $id = get_option_value('i', 'id');
-    $user = User::staticGet('id', $id);
+    $user = User::getKV('id', $id);
     if (empty($user)) {
         print "Can't find user with ID $id\n";
         exit(1);
     }
 } else if (have_option('n', 'nickname')) {
     $nickname = get_option_value('n', 'nickname');
-    $user = User::staticGet('nickname', $nickname);
+    $user = User::getKV('nickname', $nickname);
     if (empty($user)) {
         print "Can't find user with nickname '$nickname'\n";
         exit(1);
@@ -67,7 +67,7 @@ if (have_option('i', 'id')) {
 
 function clear_jabber($id)
 {
-    $user = User::staticGet('id', $id);
+    $user = User::getKV('id', $id);
     if ($user && $user->jabber) {
         echo "clearing user $id's user.jabber, was: $user->jabber";
         if (have_option('dry-run')) {
index 7b1d651e48956844fee0680a6ac2adca01d6df12..8cf44ecd2d31425d3ced4b4f1efa7e75d3083d56 100755 (executable)
@@ -51,14 +51,14 @@ function interpretCommand($user, $body)
 
 if (have_option('i', 'id')) {
     $id = get_option_value('i', 'id');
-    $user = User::staticGet('id', $id);
+    $user = User::getKV('id', $id);
     if (empty($user)) {
         print "Can't find user with ID $id\n";
         exit(1);
     }
 } else if (have_option('n', 'nickname')) {
     $nickname = get_option_value('n', 'nickname');
-    $user = User::staticGet('nickname', $nickname);
+    $user = User::getKV('nickname', $nickname);
     if (empty($user)) {
         print "Can't find user with nickname '$nickname'\n";
         exit(1);
index 9390890ef33c0f7379c38d58fee4325aefdd935e..b1955a32e3a616ee31da335d20728e1b6f9ce86c 100644 (file)
@@ -188,13 +188,13 @@ function getUser()
 
     if (have_option('i', 'id')) {
         $id = get_option_value('i', 'id');
-        $user = User::staticGet('id', $id);
+        $user = User::getKV('id', $id);
         if (empty($user)) {
             throw new Exception("Can't find user with id '$id'.");
         }
     } else if (have_option('n', 'nickname')) {
         $nickname = get_option_value('n', 'nickname');
-        $user = User::staticGet('nickname', $nickname);
+        $user = User::getKV('nickname', $nickname);
         if (empty($user)) {
             throw new Exception("Can't find user with nickname '$nickname'");
         }
index d5ed22758165a4eef35c25de47de9942985cdb26..9de855ee54cdd8b731f7f02703697332f2f1c3ac 100644 (file)
@@ -73,7 +73,7 @@ function newGroup($i, $j)
     // Pick a random user to be the admin
 
     $n = rand(0, max($j - 1, 0));
-    $user = User::staticGet('nickname', sprintf('%s%d', $userprefix, $n));
+    $user = User::getKV('nickname', sprintf('%s%d', $userprefix, $n));
 
     $group = User_group::register(array('nickname' => sprintf('%s%d', $groupprefix, $i),
                                         'local'    => true,
@@ -88,7 +88,7 @@ function newNotice($i, $tagmax)
     $options = array('scope' => Notice::defaultScope());
 
     $n = rand(0, $i - 1);
-    $user = User::staticGet('nickname', sprintf('%s%d', $userprefix, $n));
+    $user = User::getKV('nickname', sprintf('%s%d', $userprefix, $n));
 
     $is_reply = rand(0, 1);
 
@@ -192,7 +192,7 @@ function newMessage($i)
     global $userprefix;
 
     $n = rand(0, $i - 1);
-    $user = User::staticGet('nickname', sprintf('%s%d', $userprefix, $n));
+    $user = User::getKV('nickname', sprintf('%s%d', $userprefix, $n));
 
     $content = testNoticeContent();
 
@@ -216,7 +216,7 @@ function newSub($i)
 
     $fromnick = sprintf('%s%d', $userprefix, $f);
 
-    $from = User::staticGet('nickname', $fromnick);
+    $from = User::getKV('nickname', $fromnick);
 
     if (empty($from)) {
         throw new Exception("Can't find user '$fromnick'.");
@@ -233,7 +233,7 @@ function newSub($i)
 
     $tunic = sprintf('%s%d', $userprefix, $t);
 
-    $to = User::staticGet('nickname', $tunic);
+    $to = User::getKV('nickname', $tunic);
 
     if (empty($to)) {
         throw new Exception("Can't find user '$tunic'.");
@@ -254,7 +254,7 @@ function newJoin($u, $g)
 
     $userNick = sprintf('%s%d', $userprefix, $userNumber);
 
-    $user = User::staticGet('nickname', $userNick);
+    $user = User::getKV('nickname', $userNick);
 
     if (empty($user)) {
         throw new Exception("Can't find user '$fromnick'.");
@@ -264,7 +264,7 @@ function newJoin($u, $g)
 
     $groupNick = sprintf('%s%d', $groupprefix, $groupNumber);
 
-    $group = User_group::staticGet('nickname', $groupNick);
+    $group = User_group::getKV('nickname', $groupNick);
 
     if (empty($group)) {
         throw new Exception("Can't find group '$groupNick'.");
@@ -284,7 +284,7 @@ function newFave($u)
 
     $userNick = sprintf('%s%d', $userprefix, $userNumber);
 
-    $user = User::staticGet('nickname', $userNick);
+    $user = User::getKV('nickname', $userNick);
 
     if (empty($user)) {
         throw new Exception("Can't find user '$userNick'.");
@@ -296,7 +296,7 @@ function newFave($u)
 
     $otherNick = sprintf('%s%d', $userprefix, $otherNumber);
 
-    $other = User::staticGet('nickname', $otherNick);
+    $other = User::getKV('nickname', $otherNick);
 
     if (empty($other)) {
         throw new Exception("Can't find user '$otherNick'.");
index 5a1ac109fddde711e899123c2644ef50f5c8be19..f76a3dedc780e2207a3446c226fd535027450adb 100755 (executable)
@@ -37,19 +37,19 @@ require_once INSTALLDIR.'/scripts/commandline.inc';
 
 if (have_option('i', 'id')) {
     $id = get_option_value('i', 'id');
-    $group = User_group::staticGet('id', $id);
+    $group = User_group::getKV('id', $id);
     if (empty($group)) {
         print "Can't find group with ID $id\n";
         exit(1);
     }
 } else if (have_option('n', 'nickname')) {
     $nickname = get_option_value('n', 'nickname');
-    $local = Local_group::staticGet('nickname', $nickname);
+    $local = Local_group::getKV('nickname', $nickname);
     if (empty($local)) {
         print "Can't find group with nickname '$nickname'\n";
         exit(1);
     }
-    $group = User_group::staticGet('id', $local->group_id);
+    $group = User_group::getKV('id', $local->group_id);
 } else {
     print "You must provide either an ID or a nickname.\n";
     print "\n";
index 5373c73cea59fbad5dde4283c0b600de15792816..25af1c5ce24a294b8f5d74810106f92690336ae7 100755 (executable)
@@ -37,14 +37,14 @@ require_once INSTALLDIR.'/scripts/commandline.inc';
 
 if (have_option('i', 'id')) {
     $id = get_option_value('i', 'id');
-    $user = User::staticGet('id', $id);
+    $user = User::getKV('id', $id);
     if (empty($user)) {
         print "Can't find user with ID $id\n";
         exit(1);
     }
 } else if (have_option('n', 'nickname')) {
     $nickname = get_option_value('n', 'nickname');
-    $user = User::staticGet('nickname', $nickname);
+    $user = User::getKV('nickname', $nickname);
     if (empty($user)) {
         print "Can't find user with nickname '$nickname'\n";
         exit(1);
index 6b0255e720c59c6796bc9c2839cca38b9bc20029..dabd76131839e98eb6700eab8e1c1aed0ec97d7b 100755 (executable)
@@ -53,8 +53,8 @@ $dry = have_option('dry-run');
 $sub = get_blocked_subs();
 $count = $sub->N;
 while ($sub->fetch()) {
-    $subber = Profile::staticGet('id', $sub->subscriber);
-    $subbed = Profile::staticGet('id', $sub->subscribed);
+    $subber = Profile::getKV('id', $sub->subscriber);
+    $subbed = Profile::getKV('id', $sub->subscribed);
     if (!$subber || !$subbed) {
         print "Bogus entry! $sub->subscriber subbed to $sub->subscribed\n";
         continue;
index 796021b72136655ee4b9a60d64070efde58eb8e8..dc4bb822f1e593a4e624e8e06389ff9fc240fa08 100755 (executable)
@@ -159,7 +159,7 @@ class UTF8FixerUpper
                 continue;
             }
 
-            $notice = Notice::staticGet('id', $id);
+            $notice = Notice::getKV('id', $id);
             $notice->decache();
             $notice->free();
 
@@ -223,7 +223,7 @@ class UTF8FixerUpper
                 continue;
             }
 
-            $profile = Profile::staticGet('id', $id);
+            $profile = Profile::getKV('id', $id);
             $profile->decache();
             $profile->free();
 
@@ -287,7 +287,7 @@ class UTF8FixerUpper
                 continue;
             }
 
-            $user_group = User_group::staticGet('id', $id);
+            $user_group = User_group::getKV('id', $id);
             $user_group->decache();
             $user_group->free();
 
@@ -344,7 +344,7 @@ class UTF8FixerUpper
                 continue;
             }
 
-            $message = Message::staticGet('id', $id);
+            $message = Message::getKV('id', $id);
             $message->decache();
             $message->free();
 
index 8158849695e92cad7664051cd6edabdd7414ea83..eb7d8297136cdb3dd461752d0ca8bc65439120c1 100755 (executable)
@@ -44,7 +44,7 @@ if (!$handler) {
     exit(1);
 }
 
-$notice = Notice::staticGet('id', $noticeId);
+$notice = Notice::getKV('id', $noticeId);
 if (empty($notice)) {
     print "Invalid notice id $noticeId\n";
     exit(1);
index 658244db9dc4e8d151ebdb6ed616a344f1b8ba4f..e1359a7674bf1db03536fdd199b979143d2d4a16 100644 (file)
@@ -41,15 +41,15 @@ try {
     $lgroup = null;
     if (have_option('G', 'group-id')) {
         $gid = get_option_value('G', 'group-id');
-        $lgroup = Local_group::staticGet('group_id', $gid);
+        $lgroup = Local_group::getKV('group_id', $gid);
     } else if (have_option('g', 'group')) {
         $gnick = get_option_value('g', 'group');
-        $lgroup = Local_group::staticGet('nickname', $gnick);
+        $lgroup = Local_group::getKV('nickname', $gnick);
     }
     if (empty($lgroup)) {
         throw new Exception("No such local group: $gnick");
     }
-    $group = User_group::staticGet('id', $lgroup->group_id);
+    $group = User_group::getKV('id', $lgroup->group_id);
     $user->joinGroup($group);
     print "OK\n";
 } catch (Exception $e) {
index 653c3b5aad65bdd9e57bb358086059ab22b6b9e3..29282066054eb3802323620e05954cbca8bae599 100644 (file)
@@ -41,15 +41,15 @@ try {
     $lgroup = null;
     if (have_option('G', 'group-id')) {
         $gid = get_option_value('G', 'group-id');
-        $lgroup = Local_group::staticGet('group_id', $gid);
+        $lgroup = Local_group::getKV('group_id', $gid);
     } else if (have_option('g', 'group')) {
         $gnick = get_option_value('g', 'group');
-        $lgroup = Local_group::staticGet('nickname', $gnick);
+        $lgroup = Local_group::getKV('nickname', $gnick);
     }
     if (empty($lgroup)) {
         throw new Exception("No such local group: $gnick");
     }
-    $group = User_group::staticGet('id', $lgroup->group_id);
+    $group = User_group::getKV('id', $lgroup->group_id);
     $user->leaveGroup($group);
     print "OK\n";
 } catch (Exception $e) {
index a68798451cdd22b4b836a6a061f108b36c1aaf82..345d93c665745896d99c81e5d1623b56a2c3700f 100644 (file)
@@ -44,13 +44,13 @@ if (empty($nickname) || empty($groupname)) {
 
 try {
 
-    $user = User::staticGet('nickname', $nickname);
+    $user = User::getKV('nickname', $nickname);
 
     if (empty($user)) {
         throw new Exception("No user named '$nickname'.");
     }
 
-    $group = User_group::staticGet('nickname', $groupname);
+    $group = User_group::getKV('nickname', $groupname);
 
     if (empty($group)) {
         throw new Exception("No group named '$groupname'.");
index 5d9c8862daf8f1d93681bb8a2bc8f3d47eb757b1..d2a47b6be9737b27f3cc30603aefd496cdbb9344 100644 (file)
@@ -49,7 +49,7 @@ if (empty($nickname) || empty($password)) {
 
 try {
 
-    $user = User::staticGet('nickname', $nickname);
+    $user = User::getKV('nickname', $nickname);
 
     if (!empty($user)) {
         throw new Exception("A user named '$nickname' already exists.");
index 436e085bed83e1386a756fc52d865d2246472618..0441bfe7ee9abef0ebc417ca31d2e4cb8bf9a8b9 100755 (executable)
@@ -37,14 +37,14 @@ require_once INSTALLDIR.'/scripts/commandline.inc';
 
 if (have_option('i', 'id')) {
     $id = get_option_value('i', 'id');
-    $user = User::staticGet('id', $id);
+    $user = User::getKV('id', $id);
     if (empty($user)) {
         print "Can't find user with ID $id\n";
         exit(1);
     }
 } else if (have_option('n', 'nickname')) {
     $nickname = get_option_value('n', 'nickname');
-    $user = User::staticGet('nickname', $nickname);
+    $user = User::getKV('nickname', $nickname);
     if (empty($user)) {
         print "Can't find user with nickname '$nickname'\n";
         exit(1);
index 50d49d7dbfdae24177b478effe781caeed0907b8..3e9f5c17ca3e9ab8473dd8e849e7282eb703ec54 100755 (executable)
@@ -41,7 +41,7 @@ if (mb_strlen($password) < 6) {
     exit(1);
 }
 
-$user = User::staticGet('nickname', $nickname);
+$user = User::getKV('nickname', $nickname);
 
 if (!$user) {
     print "No such user '$nickname'.\n";
index b3f27be616a7b4b620d143c17784ace8cfc962e4..021b66885190dacbf944759738895272855256cc 100755 (executable)
@@ -40,14 +40,14 @@ require_once INSTALLDIR.'/scripts/commandline.inc';
 
 if (have_option('i', 'id')) {
     $id = get_option_value('i', 'id');
-    $profile = Profile::staticGet('id', $id);
+    $profile = Profile::getKV('id', $id);
     if (empty($profile)) {
         print "Can't find local or remote profile with ID $id\n";
         exit(1);
     }
 } else if (have_option('n', 'nickname')) {
     $nickname = get_option_value('n', 'nickname');
-    $user = User::staticGet('nickname', $nickname);
+    $user = User::getKV('nickname', $nickname);
     if (empty($user)) {
         print "Can't find local user with nickname '$nickname'\n";
         exit(1);
index eb7e3980235559c1d6f0f7035b5bcf583cfd2b95..b5955fd5aa9335a0ae259cdfb7baa24c3ea228bc 100644 (file)
@@ -38,7 +38,7 @@ $memc = Cache::instance();
 
 foreach ($ids as $id) {
 
-       $user = User::staticGet('id', $id);
+       $user = User::getKV('id', $id);
 
        if (!$user) {
                common_log(LOG_WARNING, 'No such user: ' . $id);
index 4110660ab0139601d3b53912c109208e308665f8..abf9627cc71e6daffc61c3b26802b7a435bece14 100644 (file)
@@ -41,14 +41,14 @@ try {
 
     if (have_option('i', 'id')) {
         $id = get_option_value('i', 'id');
-        $user = User::staticGet('id', $id);
+        $user = User::getKV('id', $id);
         if (empty($user)) {
             throw new Exception("Can't find user with id '$id'.");
         }
         updateLocation($user);
     } else if (have_option('n', 'nickname')) {
         $nickname = get_option_value('n', 'nickname');
-        $user = User::staticGet('nickname', $nickname);
+        $user = User::getKV('nickname', $nickname);
         if (empty($user)) {
             throw new Exception("Can't find user with nickname '$nickname'");
         }
index 01b3c2283bdbe371ca37b6d4d5aa049d1af60578..266204dd9fd42f18ad411669ba257e5dd82c9b77 100644 (file)
@@ -112,7 +112,7 @@ function updateGroupUrls()
         while ($group->fetch()) {
             try {
                 printfv("Updating group {$group->nickname}...");
-                $orig = User_group::staticGet('id', $group->id);
+                $orig = User_group::getKV('id', $group->id);
                 if (!empty($group->original_logo)) {
                     $group->original_logo = Avatar::url(basename($group->original_logo));
                     $group->homepage_logo = Avatar::url(basename($group->homepage_logo));
index 7d81c1983504f1fd8797a789901b118e5a76e31c..1a87b148b3354482c5b9abefd382bd92ec4e79c4 100644 (file)
@@ -124,7 +124,7 @@ function fixupNoticeConversation()
             if (empty($notice->reply_to)) {
                 $notice->conversation = $notice->id;
             } else {
-                $reply = Notice::staticGet('id', $notice->reply_to);
+                $reply = Notice::getKV('id', $notice->reply_to);
 
                 if (empty($reply)) {
                     $notice->conversation = $notice->id;
@@ -159,7 +159,7 @@ function fixupGroupURI()
 
     if ($group->find()) {
         while ($group->fetch()) {
-            $orig = User_group::staticGet('id', $group->id);
+            $orig = User_group::getKV('id', $group->id);
             $group->uri = $group->getUri();
             $group->update($orig);
         }
@@ -281,7 +281,7 @@ function initNoticeReshare()
     if ($notice->find()) {
         while ($notice->fetch()) {
             try {
-                $orig = Notice::staticGet('id', $notice->id);
+                $orig = Notice::getKV('id', $notice->id);
                 $notice->verb = ActivityVerb::SHARE;
                 $notice->object_type = ActivityObject::ACTIVITY;
                 $notice->update($orig);
index a53d857d56d3d085c16c03bfa2533be7850b818f..02c34678fb31eb1077a974a997f97c39c6e7ed56 100755 (executable)
@@ -37,14 +37,14 @@ require_once INSTALLDIR.'/scripts/commandline.inc';
 
 if (have_option('i', 'id')) {
     $id = get_option_value('i', 'id');
-    $user = User::staticGet('id', $id);
+    $user = User::getKV('id', $id);
     if (empty($user)) {
         print "Can't find user with ID $id\n";
         exit(1);
     }
 } else if (have_option('n', 'nickname')) {
     $nickname = get_option_value('n', 'nickname');
-    $user = User::staticGet('nickname', $nickname);
+    $user = User::getKV('nickname', $nickname);
     if (empty($user)) {
         print "Can't find user with nickname '$nickname'\n";
         exit(1);
@@ -84,7 +84,7 @@ if (have_option('e', 'email')) {
         if (empty($unconfirmed_email->user_id)) {
             print "No users with email $user->email\n";
         } else {
-            $user=User::staticGet('id', $unconfirmed_email->user_id);
+            $user=User::getKV('id', $unconfirmed_email->user_id);
             print "Unconfirmed Address: $user->id $user->nickname\n";
         }
         exit(0);
index a2cc7def888e2cec29fcb98d2052bb242bb98d15..d1061b18322417a6afb9c18e634dd5c6c467a78e 100644 (file)
@@ -38,14 +38,14 @@ require_once INSTALLDIR.'/scripts/commandline.inc';
 
 if (have_option('i', 'id')) {
     $id = get_option_value('i', 'id');
-    $profile = Profile::staticGet('id', $id);
+    $profile = Profile::getKV('id', $id);
     if (empty($profile)) {
         print "Can't find user with ID $id\n";
         exit(1);
     }
 } else if (have_option('n', 'nickname')) {
     $nickname = get_option_value('n', 'nickname');
-    $user = User::staticGet('nickname', $nickname);
+    $user = User::getKV('nickname', $nickname);
     if (empty($user)) {
         print "Can't find user with nickname '$nickname'\n";
         exit(1);
index 8cf1b009ed6ed5379e98d68c6d0e50f5b6d20a52..8e59050e75d605062ec6203300519d1fabdba57d 100644 (file)
@@ -521,7 +521,7 @@ class ActivityGenerationTests extends PHPUnit_Framework_TestCase
 
         $reply = Notice::saveNew($this->author1->id, $text, 'test', array('uri' => null, 'reply_to' => $orig->id));
 
-        $conv = Conversation::staticGet('id', $reply->conversation);
+        $conv = Conversation::getKV('id', $reply->conversation);
 
         $entry = $reply->asAtomEntry();
 
index d24a172f6f58adad60c030b1d0181b73eefac068..97bf195749d703bde75570f919283f3c13d33730 100644 (file)
@@ -16,7 +16,7 @@ class UserRightsTest extends PHPUnit_Framework_TestCase
 
     function setUp()
     {
-        $user = User::staticGet('nickname', 'userrightstestuser');
+        $user = User::getKV('nickname', 'userrightstestuser');
         if ($user) {
             // Leftover from a broken test run?
             $profile = $user->getProfile();