Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F72599096
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, Jul 16, 02:15
Size
640 B
Mime Type
text/x-php
Expires
Thu, Jul 18, 02:15 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
19075334
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