2015-01-28 20:13:29 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$key = 'metamta.maniphest.default-public-author';
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht("Migrating `%s` to new application email infrastructure...\n", $key);
|
2015-01-28 20:13:29 +01:00
|
|
|
$value = PhabricatorEnv::getEnvConfigIfExists($key);
|
|
|
|
$maniphest = new PhabricatorManiphestApplication();
|
|
|
|
$config_key =
|
|
|
|
PhabricatorMetaMTAApplicationEmail::CONFIG_DEFAULT_AUTHOR;
|
|
|
|
|
|
|
|
if ($value) {
|
|
|
|
$app_emails = id(new PhabricatorMetaMTAApplicationEmailQuery())
|
|
|
|
->setViewer(PhabricatorUser::getOmnipotentUser())
|
2015-01-29 23:03:45 +01:00
|
|
|
->withApplicationPHIDs(array($maniphest->getPHID()))
|
2015-01-28 20:13:29 +01:00
|
|
|
->execute();
|
|
|
|
|
|
|
|
foreach ($app_emails as $app_email) {
|
|
|
|
$app_email->setConfigValue($config_key, $value);
|
|
|
|
$app_email->save();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Done.')."\n";
|