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