Replace calls of deprecated method
authorMatthias Schmidt <gravatronics@live.com>
Thu, 7 Apr 2016 08:45:06 +0000 (10:45 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 7 Apr 2016 08:45:06 +0000 (10:45 +0200)
12 files changed:
wcfsetup/install/files/lib/data/user/UserProfileAction.class.php
wcfsetup/install/files/lib/data/user/avatar/UserAvatarAction.class.php
wcfsetup/install/files/lib/data/user/follow/UserFollowAction.class.php
wcfsetup/install/files/lib/data/user/follow/UserFollowingAction.class.php
wcfsetup/install/files/lib/data/user/ignore/UserIgnoreAction.class.php
wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorAction.class.php
wcfsetup/install/files/lib/form/MailForm.class.php
wcfsetup/install/files/lib/page/UserPage.class.php
wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php
wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php
wcfsetup/install/files/lib/system/message/quote/AbstractMessageQuoteHandler.class.php
wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php

index bfc50b637307ff1a8b46a285f8d4373315dc2431..55bd29005f886d189161d987277aff6b459a86c0 100644 (file)
@@ -3,6 +3,7 @@ namespace wcf\data\user;
 use wcf\data\object\type\ObjectTypeCache;
 use wcf\system\bbcode\BBCodeParser;
 use wcf\system\bbcode\MessageParser;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\UserInputException;
@@ -127,7 +128,7 @@ class UserProfileAction extends UserAction {
                if (count($this->objectIDs) != 1) {
                        throw new UserInputException('objectIDs');
                }
-               $this->userProfile = UserProfile::getUserProfile(reset($this->objectIDs));
+               $this->userProfile = UserProfileRuntimeCache::getInstance()->getObject(reset($this->objectIDs));
                
                if ($this->userProfile === null) {
                        throw new UserInputException('objectIDs');
@@ -175,7 +176,7 @@ class UserProfileAction extends UserAction {
        public function validateBeginEdit() {
                if (!empty($this->objectIDs) && count($this->objectIDs) == 1) {
                        $userID = reset($this->objectIDs);
-                       $this->userProfile = UserProfile::getUserProfile($userID);
+                       $this->userProfile = UserProfileRuntimeCache::getInstance()->getObject($userID);
                }
                
                if ($this->userProfile === null || !$this->userProfile->userID) {
index d134de5b5e0c7beb35957f9df474f0687643a927..36f18e15f378b3fdadf7ac1a426a3102ce8c9a22 100644 (file)
@@ -2,8 +2,8 @@
 namespace wcf\data\user\avatar;
 use wcf\data\user\User;
 use wcf\data\user\UserEditor;
-use wcf\data\user\UserProfile;
 use wcf\data\AbstractDatabaseObjectAction;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\SystemException;
@@ -340,7 +340,7 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
                        throw new PermissionDeniedException();
                }
                
-               if (!WCF::getSession()->getPermission('user.profile.avatar.canUploadAvatar') || UserProfile::getUserProfile($this->avatar->userID)->disableAvatar) {
+               if (!WCF::getSession()->getPermission('user.profile.avatar.canUploadAvatar') || UserProfileRuntimeCache::getInstance()->getObject($this->avatar->userID)->disableAvatar) {
                        throw new PermissionDeniedException();
                }
                
index 1a6cc07dcf6f5967c52503ed2a975cc5a9305277..574952e213d3bd88a1772a220366d87e2f3bba55 100644 (file)
@@ -3,6 +3,7 @@ namespace wcf\data\user\follow;
 use wcf\data\user\UserProfile;
 use wcf\data\AbstractDatabaseObjectAction;
 use wcf\data\IGroupedUserListAction;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\UserInputException;
 use wcf\system\user\activity\event\UserActivityEventHandler;
@@ -30,7 +31,7 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU
        
        /**
         * user profile object
-        * @var \wcf\data\user\UserProfile;
+        * @var UserProfile;
         */
        public $userProfile = null;
        
@@ -158,7 +159,7 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU
                $this->readInteger('pageNo');
                $this->readInteger('userID');
                
-               $this->userProfile = UserProfile::getUserProfile($this->parameters['userID']);
+               $this->userProfile = UserProfileRuntimeCache::getInstance()->getObject($this->parameters['userID']);
                if ($this->userProfile->isProtected()) {
                        throw new PermissionDeniedException();
                }
index 768caa88970ce8fdcc088cff21c6fffa7fef3b18..79c4726578e23859049ab260dc7a0360255a703c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 namespace wcf\data\user\follow;
-use wcf\data\user\UserProfile;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\user\GroupedUserList;
 use wcf\system\WCF;
@@ -28,7 +28,7 @@ class UserFollowingAction extends UserFollowAction {
                $this->readInteger('pageNo');
                $this->readInteger('userID');
                
-               $this->userProfile = UserProfile::getUserProfile($this->parameters['userID']);
+               $this->userProfile = UserProfileRuntimeCache::getInstance()->getObject($this->parameters['userID']);
                if ($this->userProfile->isProtected()) {
                        throw new PermissionDeniedException();
                }
index 7079d851d2ff49cad924393511e53c0424438455..f3fc8f08416d9ba6ff812b7304ce7202a80d7104 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 namespace wcf\data\user\ignore;
-use wcf\data\user\UserProfile;
 use wcf\data\AbstractDatabaseObjectAction;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\UserInputException;
@@ -25,7 +25,7 @@ class UserIgnoreAction extends AbstractDatabaseObjectAction {
        public function validateIgnore() {
                $this->readInteger('ignoreUserID', false, 'data');
                
-               $userProfile = UserProfile::getUserProfile($this->parameters['data']['ignoreUserID']);
+               $userProfile = UserProfileRuntimeCache::getInstance()->getObject($this->parameters['data']['ignoreUserID']);
                if ($userProfile === null || $userProfile->userID == WCF::getUser()->userID) {
                        throw new IllegalLinkException();
                }
@@ -63,7 +63,7 @@ class UserIgnoreAction extends AbstractDatabaseObjectAction {
        public function validateUnignore() {
                $this->readInteger('ignoreUserID', false, 'data');
                
-               $userProfile = UserProfile::getUserProfile($this->parameters['data']['ignoreUserID']);
+               $userProfile = UserProfileRuntimeCache::getInstance()->getObject($this->parameters['data']['ignoreUserID']);
                if ($userProfile === null) {
                        throw new IllegalLinkException();
                }
index 811062be02a50f7ed7f99b8eb83a08b8cc2e514b..df6e3a76a09b97e5790dad2b068c2c566eb07271 100644 (file)
@@ -3,6 +3,7 @@ namespace wcf\data\user\profile\visitor;
 use wcf\data\user\UserProfile;
 use wcf\data\AbstractDatabaseObjectAction;
 use wcf\data\IGroupedUserListAction;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\user\GroupedUserList;
 use wcf\system\WCF;
@@ -25,7 +26,7 @@ class UserProfileVisitorAction extends AbstractDatabaseObjectAction implements I
        
        /**
         * user profile object
-        * @var \wcf\data\user\UserProfile;
+        * @var UserProfile;
         */
        public $userProfile = null;
        
@@ -36,7 +37,7 @@ class UserProfileVisitorAction extends AbstractDatabaseObjectAction implements I
                $this->readInteger('pageNo');
                $this->readInteger('userID');
                
-               $this->userProfile = UserProfile::getUserProfile($this->parameters['userID']);
+               $this->userProfile = UserProfileRuntimeCache::getInstance()->getObject($this->parameters['userID']);
                if ($this->userProfile->isProtected()) {
                        throw new PermissionDeniedException();
                }
index d512e288159bcf11b58c7f015909a33022349a84..a9a31baa4421cff603e09834cb91e57cb6c2ca90 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\form;
 use wcf\data\user\UserProfile;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\exception\UserInputException;
@@ -35,7 +36,7 @@ class MailForm extends AbstractCaptchaForm {
        
        /**
         * recipient's user object
-        * @var \wcf\data\user\UserProfile
+        * @var UserProfile
         */
        public $user = 0;
        
@@ -70,7 +71,7 @@ class MailForm extends AbstractCaptchaForm {
                parent::readParameters();
                
                if (isset($_REQUEST['id'])) $this->userID = intval($_REQUEST['id']);
-               $this->user = UserProfile::getUserProfile($this->userID);
+               $this->user = UserProfileRuntimeCache::getInstance()->getObject($this->userID);
                if ($this->user === null) {
                        throw new IllegalLinkException();
                }
index 49c7ab034cfd7829bc594f7cfba71ca76e879602..9eb871443e4642acba1c37dc4543985be7f39034 100644 (file)
@@ -10,6 +10,7 @@ use wcf\data\user\profile\visitor\UserProfileVisitorList;
 use wcf\data\user\UserEditor;
 use wcf\data\user\UserProfile;
 use wcf\system\breadcrumb\Breadcrumb;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\PermissionDeniedException;
 use wcf\system\menu\user\profile\UserProfileMenu;
@@ -59,7 +60,7 @@ class UserPage extends AbstractPage {
        
        /**
         * user object
-        * @var \wcf\data\user\UserProfile
+        * @var UserProfile
         */
        public $user = null;
        
@@ -88,7 +89,7 @@ class UserPage extends AbstractPage {
                parent::readParameters();
                
                if (isset($_REQUEST['id'])) $this->userID = intval($_REQUEST['id']);
-               $this->user = UserProfile::getUserProfile($this->userID);
+               $this->user = UserProfileRuntimeCache::getInstance()->getObject($this->userID);
                if ($this->user === null) {
                        throw new IllegalLinkException();
                }
index 54910c76176585de05267a062f6405e3f2817c84..43e7b1f634654b47043228e5332da4f0e9817ed1 100644 (file)
@@ -5,7 +5,7 @@ use wcf\data\comment\response\CommentResponseList;
 use wcf\data\comment\Comment;
 use wcf\data\comment\CommentList;
 use wcf\data\object\type\ObjectTypeCache;
-use wcf\data\user\UserProfile;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\like\IViewableLikeProvider;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
@@ -56,7 +56,7 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa
         */
        public function isAccessible($objectID, $validateWritePermission = false) {
                // check object id
-               $userProfile = UserProfile::getUserProfile($objectID);
+               $userProfile = UserProfileRuntimeCache::getInstance()->getObject($objectID);
                if ($userProfile === null) {
                        return false;
                }
@@ -176,7 +176,7 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa
                        }
                }
                if (!empty($userIDs)) {
-                       $users = UserProfile::getUserProfiles(array_unique($userIDs));
+                       $users = UserProfileRuntimeCache::getInstance()->getObjects(array_unique($userIDs));
                }
                
                // set message
index d0fdf974872d0509bd16a5d5d610d51c6a7def61..8193471d02a5251052c81313cbb66520bfd101ae 100644 (file)
@@ -7,6 +7,7 @@ use wcf\data\user\User;
 use wcf\data\user\UserEditor;
 use wcf\data\user\UserList;
 use wcf\data\user\UserProfile;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\mail\Mail;
 use wcf\system\user\notification\UserNotificationHandler;
@@ -126,7 +127,7 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                }
                
                // load authors
-               $authors = UserProfile::getUserProfiles($authorIDs);
+               $authors = UserProfileRuntimeCache::getInstance()->getObjects($authorIDs);
                $unknownAuthor = new UserProfile(new User(null, array('userID' => null, 'username' => WCF::getLanguage()->get('wcf.user.guest'))));
                
                // load objects associated with each object type
index 5a738a80465fc6cd37f6e294b02fe829d4e138c5..bdefc4bc03468514833882462cb1bbc396b13eae 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 namespace wcf\system\message\quote;
-use wcf\data\user\UserProfile;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\SingletonFactory;
 use wcf\system\WCF;
 
@@ -42,7 +42,7 @@ abstract class AbstractMessageQuoteHandler extends SingletonFactory implements I
                
                if (!empty($userIDs)) {
                        $userIDs = array_unique($userIDs);
-                       $userProfiles = UserProfile::getUserProfiles($userIDs);
+                       $userProfiles = UserProfileRuntimeCache::getInstance()->getObjects($userIDs);
                }
                
                WCF::getTPL()->assign(array(
index 14695027a9b0963359772552307db006bebfbf3b..4729c6fa48f18d13edc87028f66d1c07f74f422f 100644 (file)
@@ -10,6 +10,7 @@ use wcf\data\user\User;
 use wcf\data\user\UserEditor;
 use wcf\data\user\UserProfile;
 use wcf\system\cache\builder\UserNotificationEventCacheBuilder;
+use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\event\EventHandler;
 use wcf\system\exception\SystemException;
@@ -99,7 +100,7 @@ class UserNotificationHandler extends SingletonFactory {
                                $userProfile = new UserProfile(WCF::getUser());
                        }
                        else {
-                               $userProfile = UserProfile::getUserProfile($notificationObject->getAuthorID());
+                               $userProfile = UserProfileRuntimeCache::getInstance()->getObject($notificationObject->getAuthorID());
                        }
                }
                if ($userProfile === null) {