Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F83465271
20160225.almanac.3.stype.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
Tue, Sep 17, 07:10
Size
640 B
Mime Type
text/x-php
Expires
Thu, Sep 19, 07:10 (2 d)
Engine
blob
Format
Raw Data
Handle
20841138
Attached To
rPH Phabricator
20160225.almanac.3.stype.php
View Options
<?php
// Previously, Almanac services stored a "serviceClass". Migrate these to
// new "serviceType" values.
$table
=
new
AlmanacService
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
foreach
(
new
LiskMigrationIterator
(
$table
)
as
$service
)
{
$new_type
=
null
;
try
{
$old_type
=
$service
->
getServiceType
();
$object
=
newv
(
$old_type
,
array
());
$new_type
=
$object
->
getServiceTypeConstant
();
}
catch
(
Exception
$ex
)
{
continue
;
}
if
(!
$new_type
)
{
continue
;
}
queryfx
(
$conn_w
,
'UPDATE %T SET serviceType = %s WHERE id = %d'
,
$table
->
getTableName
(),
$new_type
,
$service
->
getID
());
}
Event Timeline
Log In to Comment