2015-01-20 01:07:26 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$key = 'metamta.maniphest.public-create-email';
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht("Migrating `%s` to new application email infrastructure...\n", $key);
|
2015-01-20 01:07:26 +01:00
|
|
|
$value = PhabricatorEnv::getEnvConfigIfExists($key);
|
|
|
|
$maniphest = new PhabricatorManiphestApplication();
|
|
|
|
|
|
|
|
if ($value) {
|
|
|
|
try {
|
|
|
|
PhabricatorMetaMTAApplicationEmail::initializeNewAppEmail(
|
|
|
|
PhabricatorUser::getOmnipotentUser())
|
|
|
|
->setAddress($value)
|
|
|
|
->setApplicationPHID($maniphest->getPHID())
|
|
|
|
->save();
|
|
|
|
} catch (AphrontDuplicateKeyQueryException $ex) {
|
2015-05-22 09:27:56 +02:00
|
|
|
// Already migrated?
|
2015-01-20 01:07:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Done.')."\n";
|