Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1102558
20160222.almanac.1.properties.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
695 B
Referenced Files
None
Subscribers
None
20160222.almanac.1.properties.php
View Options
<?php
$table
=
new
AlmanacProperty
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
// We're going to JSON-encode the value in each row: previously rows stored
// plain strings, but now they store JSON, so we need to update them.
foreach
(
new
LiskMigrationIterator
(
$table
)
as
$property
)
{
$key
=
$property
->
getFieldName
();
$current_row
=
queryfx_one
(
$conn_w
,
'SELECT fieldValue FROM %T WHERE id = %d'
,
$table
->
getTableName
(),
$property
->
getID
());
if
(!
$current_row
)
{
continue
;
}
queryfx
(
$conn_w
,
'UPDATE %T SET fieldValue = %s WHERE id = %d'
,
$table
->
getTableName
(),
phutil_json_encode
(
$current_row
[
'fieldValue'
]),
$property
->
getID
());
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jun 30, 4:39 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
274570
Default Alt Text
20160222.almanac.1.properties.php (695 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment