Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91221007
20190206.external.04.providerlink.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Nov 9, 02:44
Size
839 B
Mime Type
text/x-php
Expires
Mon, Nov 11, 02:44 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22219266
Attached To
rPH Phabricator
20190206.external.04.providerlink.php
View Options
<?php
$account_table
=
new
PhabricatorExternalAccount
();
$account_conn
=
$account_table
->
establishConnection
(
'w'
);
$table_name
=
$account_table
->
getTableName
();
$config_table
=
new
PhabricatorAuthProviderConfig
();
$config_conn
=
$config_table
->
establishConnection
(
'w'
);
foreach
(
new
LiskRawMigrationIterator
(
$account_conn
,
$table_name
)
as
$row
)
{
if
(
strlen
(
$row
[
'providerConfigPHID'
]))
{
continue
;
}
$config_row
=
queryfx_one
(
$config_conn
,
'SELECT phid
FROM %R
WHERE providerType = %s AND providerDomain = %s
LIMIT 1'
,
$config_table
,
$row
[
'accountType'
],
$row
[
'accountDomain'
]);
if
(!
$config_row
)
{
continue
;
}
queryfx
(
$account_conn
,
'UPDATE %R
SET providerConfigPHID = %s
WHERE id = %d'
,
$account_table
,
$config_row
[
'phid'
],
$row
[
'id'
]);
}
Event Timeline
Log In to Comment