@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at recaptime-dev/main 59 lines 1.6 kB view raw
1<?php 2 3// Move timezone, translation and pronoun from the user object to preferences 4// so they can be defaulted and edited like other settings. 5 6$table = new PhabricatorUser(); 7$conn_w = $table->establishConnection('w'); 8$table_name = $table->getTableName(); 9$prefs_table = new PhabricatorUserPreferences(); 10 11foreach (new LiskRawMigrationIterator($conn_w, $table_name) as $row) { 12 $phid = $row['phid']; 13 14 $pref_row = queryfx_one( 15 $conn_w, 16 'SELECT preferences FROM %T WHERE userPHID = %s', 17 $prefs_table->getTableName(), 18 $phid); 19 20 if ($pref_row) { 21 try { 22 $prefs = phutil_json_decode($pref_row['preferences']); 23 } catch (Exception $ex) { 24 $prefs = array(); 25 } 26 } else { 27 $prefs = array(); 28 } 29 30 $zone = $row['timezoneIdentifier']; 31 if (strlen($zone)) { 32 $prefs[PhabricatorTimezoneSetting::SETTINGKEY] = $zone; 33 } 34 35 $pronoun = $row['sex']; 36 if (strlen($pronoun)) { 37 $prefs[PhabricatorPronounSetting::SETTINGKEY] = $pronoun; 38 } 39 40 $translation = $row['translation']; 41 if (strlen($translation)) { 42 $prefs[PhabricatorTranslationSetting::SETTINGKEY] = $translation; 43 } 44 45 if ($prefs) { 46 queryfx( 47 $conn_w, 48 'INSERT INTO %T (phid, userPHID, preferences, dateModified, dateCreated) 49 VALUES (%s, %s, %s, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()) 50 ON DUPLICATE KEY UPDATE preferences = VALUES(preferences)', 51 $prefs_table->getTableName(), 52 $prefs_table->generatePHID(), 53 $phid, 54 phutil_json_encode($prefs)); 55 } 56} 57 58$prefs_key = PhabricatorUserPreferencesCacheType::KEY_PREFERENCES; 59PhabricatorUserCache::clearCacheForAllUsers($prefs_key);