From: Tim Düsterhus Date: Tue, 31 May 2022 08:39:30 +0000 (+0200) Subject: Deprecate SessionHandler::getLanguageIDs() X-Git-Tag: 6.0.0_Alpha_1~1232^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=51d8e23a4237493690739ff840297e2dbf193e21;p=GitHub%2FWoltLab%2FWCF.git Deprecate SessionHandler::getLanguageIDs() This method is currently unused and basically only wraps User::getLanguageIDs(). As it is unused the WCFSetup workaround should no longer be required either. --- diff --git a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php index 3b9005ec3e..8967a4e670 100644 --- a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php +++ b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php @@ -72,12 +72,6 @@ final class SessionHandler extends SingletonFactory */ protected $languageID = 0; - /** - * language ids for active user - * @var int[] - */ - protected $languageIDs; - /** * @var string */ @@ -844,43 +838,15 @@ final class SessionHandler extends SingletonFactory } /** - * Returns language ids for active user. - * - * @return int[] + * @deprecated 5.6 Use User::getLanguageIDs() instead. */ public function getLanguageIDs() { - $this->loadLanguageIDs(); - - return $this->languageIDs; - } - - /** - * Loads language ids for active user. - */ - protected function loadLanguageIDs() - { - if ($this->languageIDs !== null) { - return; - } - - $this->languageIDs = []; - if (!$this->user->userID) { - return; + return []; } - // work-around for setup process (package wcf does not exist yet) - if (!PACKAGE_ID) { - $sql = "SELECT languageID - FROM wcf1_user_to_language - WHERE userID = ?"; - $statement = WCF::getDB()->prepare($sql); - $statement->execute([$this->user->userID]); - $this->languageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); - } else { - $this->languageIDs = $this->user->getLanguageIDs(); - } + return $this->user->getLanguageIDs(); } /** @@ -1006,7 +972,6 @@ final class SessionHandler extends SingletonFactory // reset caches $this->groupData = null; - $this->languageIDs = null; $this->languageID = $this->user->languageID; // change language