Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/storage/PhabricatorUser.php
| Show First 20 Lines • Show All 480 Lines • ▼ Show 20 Lines | public function getUserSetting($key) { | ||||
| $settings_key = PhabricatorUserPreferencesCacheType::KEY_PREFERENCES; | $settings_key = PhabricatorUserPreferencesCacheType::KEY_PREFERENCES; | ||||
| if ($this->getPHID()) { | if ($this->getPHID()) { | ||||
| $settings = $this->requireCacheData($settings_key); | $settings = $this->requireCacheData($settings_key); | ||||
| } else { | } else { | ||||
| $settings = array(); | $settings = array(); | ||||
| } | } | ||||
| $defaults = PhabricatorSetting::getAllEnabledSettings($this); | // NOTE: To slightly improve performance, we're using all settings here, | ||||
| // not just settings that are enabled for the current viewer. It's fine to | |||||
| // get the value of a setting that we wouldn't let the user edit in the UI. | |||||
| $defaults = PhabricatorSetting::getAllSettings(); | |||||
| if (array_key_exists($key, $settings)) { | if (array_key_exists($key, $settings)) { | ||||
| $value = $settings[$key]; | $value = $settings[$key]; | ||||
| // Make sure the value is valid before we return it. This makes things | // Make sure the value is valid before we return it. This makes things | ||||
| // more robust when options are changed or removed. | // more robust when options are changed or removed. | ||||
| if (isset($defaults[$key])) { | if (isset($defaults[$key])) { | ||||
| try { | try { | ||||
| ▲ Show 20 Lines • Show All 996 Lines • Show Last 20 Lines | |||||