Page MenuHomePhabricator
Paste P2026


Authored by jimh on Dec 13 2016, 3:28 AM.
Had to do a little freehand scribbling to remove some company stuff and extra distracting functionality, but I'm pretty sure this will still work. Execute the code thus:
$ php email2uer.php jdoe
It should just come back with something like:
(or warn you that this user id isn't in the Phabricator SQL database...)
Then use it however you'd like. Thanks Chad and staff for your patience.
$root = "/Users/yourinstalldir/phabricator";
require_once $root.'/scripts/__init_script__.php';
if ($argc !== 2) {
print "Usage mail2user.php <username>";
$username = $argv[1];
$existing_user = id(new PhabricatorUser())->loadOneWhere(
'username = %s',
if (!$existing_user) {
print "*** ERROR - username $username is not a valid Phabricator user.";
return 1;
$PHID = $existing_user->getPHID();
$existing_email = id(new PhabricatorUserEmail())->loadOneWhere(
'userPHID = %s',
$address = $existing_email->getAddress();
print "$address";
return 0;

Event Timeline