1
0
Fork 0

Rename DBM method calls to DBA method calls

This commit is contained in:
Hypolite Petovan 2018-07-21 08:40:21 -04:00 committed by Hypolite Petovan
commit 0ec44f3e8a
153 changed files with 813 additions and 918 deletions

View file

@ -11,7 +11,6 @@ use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Database\DBM;
use Friendica\Network\Probe;
use Friendica\Protocol\PortableContact;
use Friendica\Util\DateTimeFormat;
@ -106,7 +105,7 @@ class GContact
intval($zcid)
);
if (!DBM::is_result($r)) {
if (!DBA::is_result($r)) {
q(
"INSERT INTO `glink` (`cid`, `uid`, `gcid`, `zcid`, `updated`) VALUES (%d, %d, %d, %d, '%s') ",
intval($cid),
@ -180,7 +179,7 @@ class GContact
dbesc(normalise_link($gcontact['url'])),
dbesc(NETWORK_STATUSNET)
);
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
$gcontact['network'] = $r[0]["network"];
}
@ -191,7 +190,7 @@ class GContact
dbesc(normalise_link($gcontact['url'])),
dbesc(NETWORK_STATUSNET)
);
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
$gcontact['network'] = $r[0]["network"];
}
}
@ -205,7 +204,7 @@ class GContact
dbesc(normalise_link($gcontact['url']))
);
if (DBM::is_result($x)) {
if (DBA::is_result($x)) {
if (!isset($gcontact['network']) && ($x[0]["network"] != NETWORK_STATUSNET)) {
$gcontact['network'] = $x[0]["network"];
}
@ -290,7 +289,7 @@ class GContact
);
// logger("countCommonFriends: $uid $cid {$r[0]['total']}");
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
return $r[0]['total'];
}
return 0;
@ -312,7 +311,7 @@ class GContact
intval($uid)
);
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
return $r[0]['total'];
}
@ -353,7 +352,7 @@ class GContact
intval($limit)
);
/// @TODO Check all calling-findings of this function if they properly use DBM::is_result()
/// @TODO Check all calling-findings of this function if they properly use DBA::is_result()
return $r;
}
@ -385,7 +384,7 @@ class GContact
intval($limit)
);
/// @TODO Check all calling-findings of this function if they properly use DBM::is_result()
/// @TODO Check all calling-findings of this function if they properly use DBA::is_result()
return $r;
}
@ -405,7 +404,7 @@ class GContact
intval($uid)
);
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
return $r[0]['total'];
}
@ -436,7 +435,7 @@ class GContact
intval($limit)
);
/// @TODO Check all calling-findings of this function if they properly use DBM::is_result()
/// @TODO Check all calling-findings of this function if they properly use DBA::is_result()
return $r;
}
@ -496,7 +495,7 @@ class GContact
intval($limit)
);
if (DBM::is_result($r) && count($r) >= ($limit -1)) {
if (DBA::is_result($r) && count($r) >= ($limit -1)) {
/*
* Uncommented because the result of the queries are to big to store it in the cache.
* We need to decide if we want to change the db column type or if we want to delete it.
@ -585,7 +584,7 @@ class GContact
dbesc(NETWORK_DIASPORA)
);
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
foreach ($r as $rr) {
$base = substr($rr['poco'], 0, strrpos($rr['poco'], '/'));
if (! in_array($base, $done)) {
@ -694,7 +693,7 @@ class GContact
dbesc(normalise_link($contact["url"]))
);
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
$gcontact_id = $r[0]["id"];
// Update every 90 days
@ -729,7 +728,7 @@ class GContact
dbesc(normalise_link($contact["url"]))
);
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
$gcontact_id = $r[0]["id"];
$doprobing = in_array($r[0]["network"], [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS, ""]);
@ -878,7 +877,7 @@ class GContact
/// @todo Check if we really should do this.
// The quality of the gcontact table is mostly lower than the public contact
$public_contact = DBA::selectFirst('contact', ['id'], ['nurl' => normalise_link($contact["url"]), 'uid' => 0]);
if (DBM::is_result($public_contact)) {
if (DBA::is_result($public_contact)) {
logger("Update public contact ".$public_contact["id"], LOGGER_DEBUG);
Contact::updateAvatar($contact["photo"], 0, $public_contact["id"]);
@ -1053,7 +1052,7 @@ class GContact
dbesc($last_update)
);
if (!DBM::is_result($r)) {
if (!DBA::is_result($r)) {
return;
}
@ -1076,7 +1075,7 @@ class GContact
dbesc(NETWORK_DFRN)
);
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
return dirname($r[0]['url']);
}