1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 10:42:41 +01:00
phorge-phorge/resources/sql/autopatches/20150116.maniphestapplicationemails.php

21 lines
570 B
PHP
Raw Normal View History

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