Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F554822
20161210.dashboards.01.author.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
901 B
Referenced Files
None
Subscribers
None
20161210.dashboards.01.author.php
View Options
<?php
// Set authorPHID on Dashboards
//
$table
=
new
PhabricatorDashboard
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
$txn_table
=
new
PhabricatorDashboardTransaction
();
$txn_conn
=
$table
->
establishConnection
(
'r'
);
echo
pht
(
"Building Dashboard authorPHIDs...
\n
"
);
foreach
(
new
LiskMigrationIterator
(
$table
)
as
$dashboard
)
{
if
(
$dashboard
->
getAuthorPHID
())
{
continue
;
}
$author_row
=
queryfx_one
(
$txn_conn
,
'SELECT authorPHID FROM %T WHERE objectPHID = %s ORDER BY id ASC LIMIT 1'
,
$txn_table
->
getTableName
(),
$dashboard
->
getPHID
());
if
(!
$author_row
)
{
$author_phid
=
id
(
new
PhabricatorDashboardApplication
())->
getPHID
();
}
else
{
$author_phid
=
$author_row
[
'authorPHID'
];
}
queryfx
(
$conn_w
,
'UPDATE %T SET authorPHID = %s WHERE id = %d'
,
$table
->
getTableName
(),
$author_phid
,
$dashboard
->
getID
());
}
echo
pht
(
"Done
\n
"
);
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 6:16 PM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
124727
Default Alt Text
20161210.dashboards.01.author.php (901 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment