Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / resources / sql / autopatches / 20150120.maniphestdefaultauthor.php
blob352dd4cbbd936ef94e137533a995477687c7b6c0
1 <?php
3 $key = 'metamta.maniphest.default-public-author';
4 echo pht("Migrating `%s` to new application email infrastructure...\n", $key);
5 $value = PhabricatorEnv::getEnvConfigIfExists($key);
6 $maniphest = new PhabricatorManiphestApplication();
7 $config_key =
8 PhabricatorMetaMTAApplicationEmail::CONFIG_DEFAULT_AUTHOR;
10 if ($value) {
11 $app_emails = id(new PhabricatorMetaMTAApplicationEmailQuery())
12 ->setViewer(PhabricatorUser::getOmnipotentUser())
13 ->withApplicationPHIDs(array($maniphest->getPHID()))
14 ->execute();
16 foreach ($app_emails as $app_email) {
17 $app_email->setConfigValue($config_key, $value);
18 $app_email->save();
22 echo pht('Done.')."\n";