@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$key_files = 'metamta.files.public-create-email';
4$key_paste = 'metamta.paste.public-create-email';
5echo pht(
6 "Migrating `%s` and `%s` to new application email infrastructure...\n",
7 $key_files,
8 $key_paste);
9
10$value_files = PhabricatorEnv::getEnvConfigIfExists($key_files);
11$files_app = new PhabricatorFilesApplication();
12
13if ($value_files) {
14 try {
15 PhabricatorMetaMTAApplicationEmail::initializeNewAppEmail(
16 PhabricatorUser::getOmnipotentUser())
17 ->setAddress($value_files)
18 ->setApplicationPHID($files_app->getPHID())
19 ->save();
20 } catch (AphrontDuplicateKeyQueryException $ex) {
21 // Already migrated?
22 }
23}
24
25$value_paste = PhabricatorEnv::getEnvConfigIfExists($key_paste);
26$paste_app = new PhabricatorPasteApplication();
27
28if ($value_paste) {
29 try {
30 PhabricatorMetaMTAApplicationEmail::initializeNewAppEmail(
31 PhabricatorUser::getOmnipotentUser())
32 ->setAddress($value_paste)
33 ->setApplicationPHID($paste_app->getPHID())
34 ->save();
35 } catch (AphrontDuplicateKeyQueryException $ex) {
36 // Already migrated?
37 }
38}
39
40echo pht('Done.')."\n";