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

@ -9,7 +9,6 @@ use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Database\DBM;
use Friendica\Module\Login;
use Friendica\Protocol\DFRN;
use Friendica\Protocol\OStatus;
@ -101,7 +100,7 @@ function dfrn_poll_init(App $a)
dbesc($a->argv[1])
);
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
$s = Network::fetchUrl($r[0]['poll'] . '?dfrn_id=' . $my_id . '&type=profile-check');
logger("dfrn_poll: old profile returns " . $s, LOGGER_DATA);
@ -147,7 +146,7 @@ function dfrn_poll_init(App $a)
$r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1",
dbesc($sec)
);
if (!DBM::is_result($r)) {
if (!DBA::is_result($r)) {
System::xmlExit(3, 'No ticket');
// NOTREACHED
}
@ -160,7 +159,7 @@ function dfrn_poll_init(App $a)
$c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
intval($r[0]['cid'])
);
if (!DBM::is_result($c)) {
if (!DBA::is_result($c)) {
System::xmlExit(3, 'No profile');
}
@ -211,7 +210,7 @@ function dfrn_poll_init(App $a)
DBA::delete('profile_check', ["`expire` < ?", time()]);
$r = q("SELECT * FROM `profile_check` WHERE `dfrn_id` = '%s' ORDER BY `expire` DESC",
dbesc($dfrn_id));
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
System::xmlExit(1);
return; // NOTREACHED
}
@ -239,7 +238,7 @@ function dfrn_poll_post(App $a)
$r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1",
dbesc($sec)
);
if (!DBM::is_result($r)) {
if (!DBA::is_result($r)) {
System::xmlExit(3, 'No ticket');
// NOTREACHED
}
@ -252,7 +251,7 @@ function dfrn_poll_post(App $a)
$c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
intval($r[0]['cid'])
);
if (!DBM::is_result($c)) {
if (!DBA::is_result($c)) {
System::xmlExit(3, 'No profile');
}
@ -301,7 +300,7 @@ function dfrn_poll_post(App $a)
dbesc($challenge)
);
if (!DBM::is_result($r)) {
if (!DBA::is_result($r)) {
killme();
}
@ -330,7 +329,7 @@ function dfrn_poll_post(App $a)
}
$r = q("SELECT * FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1");
if (!DBM::is_result($r)) {
if (!DBA::is_result($r)) {
killme();
}
@ -346,7 +345,7 @@ function dfrn_poll_post(App $a)
$reputation = 0;
$text = '';
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
$reputation = $r[0]['rating'];
$text = $r[0]['reason'];
@ -458,7 +457,7 @@ function dfrn_poll_content(App $a)
AND `user`.`nickname` = '%s' $sql_extra LIMIT 1",
dbesc($nickname)
);
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
$challenge = '';
$encrypted_id = '';
$id_str = $my_id . '.' . mt_rand(1000, 9999);
@ -499,7 +498,7 @@ function dfrn_poll_content(App $a)
]);
}
$profile = ((DBM::is_result($r) && $r[0]['nickname']) ? $r[0]['nickname'] : $nickname);
$profile = ((DBA::is_result($r) && $r[0]['nickname']) ? $r[0]['nickname'] : $nickname);
switch ($destination_url) {
case 'profile':