Remove product literal strings in "pht()", part 21
[phabricator.git] / resources / sql / autopatches / 20140722.appname.php
blobdd8e929357a7807765e9a2a4876bd8ca6819163d
1 <?php
3 $applications = array(
4 'Audit',
5 'Auth',
6 'Calendar',
7 'ChatLog',
8 'Conduit',
9 'Config',
10 'Conpherence',
11 'Countdown',
12 'Daemons',
13 'Dashboard',
14 'Differential',
15 'Diffusion',
16 'Diviner',
17 'Doorkeeper',
18 'Drydock',
19 'Fact',
20 'Feed',
21 'Files',
22 'Flags',
23 'Harbormaster',
24 'Help',
25 'Herald',
26 'Home',
27 'Legalpad',
28 'Macro',
29 'MailingLists',
30 'Maniphest',
31 'Applications',
32 'MetaMTA',
33 'Notifications',
34 'Nuance',
35 'OAuthServer',
36 'Owners',
37 'Passphrase',
38 'Paste',
39 'People',
40 'Phame',
41 'Phlux',
42 'Pholio',
43 'Phortune',
44 'PHPAST',
45 'Phragment',
46 'Phrequent',
47 'Phriction',
48 'Policy',
49 'Ponder',
50 'Project',
51 'Releeph',
52 'Repositories',
53 'Search',
54 'Settings',
55 'Slowvote',
56 'Subscriptions',
57 'Support',
58 'System',
59 'Test',
60 'Tokens',
61 'Transactions',
62 'Typeahead',
63 'UIExamples',
64 'XHProf',
66 $map = array();
68 foreach ($applications as $application) {
69 $old_name = 'PhabricatorApplication'.$application;
70 $new_name = 'Phabricator'.$application.'Application';
71 $map[$old_name] = $new_name;
75 /* -( User preferences )--------------------------------------------------- */
78 // This originally migrated pinned applications in user preferences, but was
79 // removed to simplify preference changes after about 22 months.
82 /* -( Dashboard installs )------------------------------------------------- */
84 // This originally migrated dashboard install locations, but was removed
85 // after about 5 years.
87 /* -( Phabricator configuration )------------------------------------------ */
89 $config_key = 'phabricator.uninstalled-applications';
90 echo pht('Migrating `%s` config...', $config_key)."\n";
92 $config = PhabricatorConfigEntry::loadConfigEntry($config_key);
93 $old_config = $config->getValue();
94 $new_config = array();
96 if ($old_config) {
97 foreach ($old_config as $application => $uninstalled) {
98 $new_config[idx($map, $application, $application)] = $uninstalled;
101 $config
102 ->setIsDeleted(0)
103 ->setValue($new_config)
104 ->save();
108 /* -( phabricator.application-settings )----------------------------------- */
110 $config_key = 'phabricator.application-settings';
111 echo pht('Migrating `%s` config...', $config_key)."\n";
113 $config = PhabricatorConfigEntry::loadConfigEntry($config_key);
114 $old_config = $config->getValue();
115 $new_config = array();
117 if ($old_config) {
118 foreach ($old_config as $application => $settings) {
119 $application = preg_replace('/^PHID-APPS-/', '', $application);
120 $new_config['PHID-APPS-'.idx($map, $application, $application)] = $settings;
123 $config
124 ->setIsDeleted(0)
125 ->setValue($new_config)
126 ->save();