streams/Zotlabs/Update/_1223.php

39 lines
1,013 B
PHP
Raw Normal View History

2018-11-21 03:15:15 +00:00
<?php
namespace Zotlabs\Update;
2021-12-02 23:02:31 +00:00
class _1223
{
public function run()
{
foreach (['abconfig', 'config', 'pconfig', 'xconfig', 'iconfig'] as $tbl) {
while (1) {
2021-12-03 03:01:39 +00:00
$r = q(
"select id, v from %s where v like '%s' limit 100 ",
2021-12-02 23:02:31 +00:00
dbesc($tbl),
dbesc('a:%')
);
if (!$r) {
break;
}
foreach ($r as $rv) {
$s = unserialize($rv['v']);
2021-12-03 03:01:39 +00:00
if ($s && is_array($s)) {
2021-12-02 23:02:31 +00:00
$s = serialise($s);
2021-12-03 03:01:39 +00:00
} else {
2021-12-02 23:02:31 +00:00
$s = $rv['v'];
2021-12-03 03:01:39 +00:00
}
q(
"update %s set v = '%s' where id = %d",
2021-12-02 23:02:31 +00:00
dbesc($tbl),
dbesc($s),
dbesc($rv['id'])
);
}
}
}
return UPDATE_SUCCESS;
}
2018-11-21 03:15:15 +00:00
}