Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1355032
20180910.audit.01.searches.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
20180910.audit.01.searches.php
View Options
<?php
$table
=
new
PhabricatorSavedQuery
();
$conn
=
$table
->
establishConnection
(
'w'
);
$status_map
=
array
(
0
=>
'none'
,
1
=>
'needs-audit'
,
2
=>
'concern-raised'
,
3
=>
'partially-audited'
,
4
=>
'audited'
,
5
=>
'needs-verification'
,
);
foreach
(
new
LiskMigrationIterator
(
$table
)
as
$query
)
{
if
(
$query
->
getEngineClassName
()
!==
'PhabricatorCommitSearchEngine'
)
{
continue
;
}
$parameters
=
$query
->
getParameters
();
$status
=
idx
(
$parameters
,
'statuses'
);
if
(!
$status
)
{
// No saved "status" constraint.
continue
;
}
if
(!
is_array
(
$status
))
{
// Saved constraint isn't a list.
continue
;
}
// Migrate old integer values to new string values.
$old_status
=
$status
;
foreach
(
$status
as
$key
=>
$value
)
{
if
(
is_numeric
(
$value
))
{
$status
[
$key
]
=
$status_map
[
$value
];
}
}
if
(
$status
===
$old_status
)
{
// Nothing changed.
continue
;
}
$parameters
[
'statuses'
]
=
$status
;
queryfx
(
$conn
,
'UPDATE %T SET parameters = %s WHERE id = %d'
,
$table
->
getTableName
(),
phutil_json_encode
(
$parameters
),
$query
->
getID
());
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jul 6, 8:51 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
319343
Default Alt Text
20180910.audit.01.searches.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment