X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FTagUpdate.php;h=213c26ac0ad0e234d25c53c3ebd03aa587bba311;hb=066ad8c01b25b7101ad6fb36878d85c97db51a6f;hp=f6a141ad6d543eef8d1aa605c7e42148c9f53acd;hpb=6d2d15a80d2fbf68ec2086bdcc9f911f8bef1077;p=friendica.git diff --git a/src/Worker/TagUpdate.php b/src/Worker/TagUpdate.php index f6a141ad6d..213c26ac0a 100644 --- a/src/Worker/TagUpdate.php +++ b/src/Worker/TagUpdate.php @@ -2,38 +2,39 @@ namespace Friendica\Worker; -use dba; +use Friendica\Core\Logger; +use Friendica\Database\DBA; class TagUpdate { public static function execute() { - $messages = dba::p("SELECT `oid`,`item`.`guid`, `item`.`created`, `item`.`received` FROM `term` INNER JOIN `item` ON `item`.`id`=`term`.`oid` WHERE `term`.`otype` = 1 AND `term`.`guid` = ''"); + $messages = DBA::p("SELECT `oid`,`item`.`guid`, `item`.`created`, `item`.`received` FROM `term` INNER JOIN `item` ON `item`.`id`=`term`.`oid` WHERE `term`.`otype` = 1 AND `term`.`guid` = ''"); - logger('fetched messages: ' . dba::num_rows($messages)); - while ($message = dba::fetch($messages)) { + Logger::log('fetched messages: ' . DBA::numRows($messages)); + while ($message = DBA::fetch($messages)) { if ($message['uid'] == 0) { $global = true; - dba::update('term', ['global' => true], ['otype' => TERM_OBJ_POST, 'guid' => $message['guid']]); + DBA::update('term', ['global' => true], ['otype' => TERM_OBJ_POST, 'guid' => $message['guid']]); } else { - $global = (dba::count('term', ['uid' => 0, 'otype' => TERM_OBJ_POST, 'guid' => $message['guid']]) > 0); + $global = (DBA::count('term', ['uid' => 0, 'otype' => TERM_OBJ_POST, 'guid' => $message['guid']]) > 0); } $fields = ['guid' => $message['guid'], 'created' => $message['created'], 'received' => $message['received'], 'global' => $global]; - dba::update('term', $fields, ['otype' => TERM_OBJ_POST, 'oid' => $message['oid']]); + DBA::update('term', $fields, ['otype' => TERM_OBJ_POST, 'oid' => $message['oid']]); } - dba::close($messages); + DBA::close($messages); - $messages = dba::p("SELECT `guid` FROM `item` WHERE `uid` = 0"); + $messages = DBA::select('item', ['guid'], ['uid' => 0]); - logger('fetched messages: ' . dba::num_rows($messages)); - while ($message = dba::fetch(messages)) { - dba::update('item', ['global' => true], ['guid' => $message['guid']]); + Logger::log('fetched messages: ' . DBA::numRows($messages)); + while ($message = DBA::fetch($messages)) { + DBA::update('item', ['global' => true], ['guid' => $message['guid']]); } - dba::close($messages); + DBA::close($messages); } }