Rename Friendica\Database\dba to Friendica\Database\DBA

This commit is contained in:
Hypolite Petovan 2018-07-20 08:19:26 -04:00
parent b6a1df0598
commit af6dbc654f
127 changed files with 1169 additions and 1169 deletions

View file

@ -6,7 +6,7 @@ namespace Friendica\Content;
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Database\dba;
use Friendica\Database\DBA;
use Friendica\Database\DBM;
/**
@ -26,8 +26,8 @@ class ContactSelector
$o .= "<select id=\"contact-profile-selector\" class=\"form-control\" $disabled name=\"profile-assign\" >\r\n";
$s = dba::select('profile', ['id', 'profile-name', 'is-default'], ['uid' => $_SESSION['uid']]);
$r = dba::inArray($s);
$s = DBA::select('profile', ['id', 'profile-name', 'is-default'], ['uid' => $_SESSION['uid']]);
$r = DBA::inArray($s);
if (DBM::is_result($r)) {
foreach ($r as $rr) {
@ -102,7 +102,7 @@ class ContactSelector
$networkname = str_replace($search, $replace, $s);
if ((in_array($s, [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS])) && ($profile != "")) {
$r = dba::fetch_first("SELECT `gserver`.`platform` FROM `gcontact`
$r = DBA::fetch_first("SELECT `gserver`.`platform` FROM `gcontact`
INNER JOIN `gserver` ON `gserver`.`nurl` = `gcontact`.`server_url`
WHERE `gcontact`.`nurl` = ? AND `platform` != ''", normalise_link($profile));

View file

@ -8,7 +8,7 @@ namespace Friendica\Content;
use Friendica\Content\Feature;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\dba;
use Friendica\Database\DBA;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
@ -45,7 +45,7 @@ class ForumManager
$select = '(`forum` OR `prv`)';
}
$contacts = dba::p(
$contacts = DBA::p(
"SELECT `contact`.`id`, `contact`.`url`, `contact`.`name`, `contact`.`micro`, `contact`.`thumb`
FROM `contact`
WHERE `network`= 'dfrn' AND $select AND `uid` = ?
@ -59,7 +59,7 @@ class ForumManager
return($forumlist);
}
while ($contact = dba::fetch($contacts)) {
while ($contact = DBA::fetch($contacts)) {
$forumlist[] = [
'url' => $contact['url'],
'name' => $contact['name'],
@ -68,7 +68,7 @@ class ForumManager
'thumb' => $contact['thumb'],
];
}
dba::close($contacts);
DBA::close($contacts);
return($forumlist);
}

View file

@ -10,7 +10,7 @@ use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\dba;
use Friendica\Database\DBA;
use Friendica\Database\DBM;
use Friendica\Model\Profile;
@ -105,7 +105,7 @@ class Nav
$nav['usermenu'][] = ['notes/', L10n::t('Personal notes'), '', L10n::t('Your personal notes')];
// user info
$contact = dba::selectFirst('contact', ['micro'], ['uid' => $a->user['uid'], 'self' => true]);
$contact = DBA::selectFirst('contact', ['micro'], ['uid' => $a->user['uid'], 'self' => true]);
$userinfo = [
'icon' => (DBM::is_result($contact) ? $a->remove_baseurl($contact['micro']) : 'images/person-48.jpg'),
'name' => $a->user['username'],

View file

@ -15,7 +15,7 @@ use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\dba;
use Friendica\Database\DBA;
use Friendica\Database\DBM;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
@ -63,7 +63,7 @@ class OEmbed
$a = get_app();
$condition = ['url' => normalise_link($embedurl), 'maxwidth' => $a->videowidth];
$oembed = dba::selectFirst('oembed', ['content'], $condition);
$oembed = DBA::selectFirst('oembed', ['content'], $condition);
if (DBM::is_result($oembed)) {
$txt = $oembed["content"];
} else {
@ -110,7 +110,7 @@ class OEmbed
} else { //save in cache
$j = json_decode($txt);
if (!empty($j->type) && $j->type != "error") {
dba::insert('oembed', [
DBA::insert('oembed', [
'url' => normalise_link($embedurl),
'maxwidth' => $a->videowidth,
'content' => $txt,

View file

@ -11,7 +11,7 @@ use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\dba;
use Friendica\Database\DBA;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
@ -143,18 +143,18 @@ class Widget
$extra_sql = self::unavailableNetworks();
$r = dba::p("SELECT DISTINCT(`network`) FROM `contact` WHERE `uid` = ? AND `network` != '' $extra_sql ORDER BY `network`",
$r = DBA::p("SELECT DISTINCT(`network`) FROM `contact` WHERE `uid` = ? AND `network` != '' $extra_sql ORDER BY `network`",
local_user()
);
$nets = array();
while ($rr = dba::fetch($r)) {
while ($rr = DBA::fetch($r)) {
/// @TODO If 'network' is not there, this triggers an E_NOTICE
if ($rr['network']) {
$nets[] = array('ref' => $rr['network'], 'name' => ContactSelector::networkToName($rr['network']), 'selected' => (($selected == $rr['network']) ? 'selected' : '' ));
}
}
dba::close($r);
DBA::close($r);
if (count($nets) < 2) {
return '';
@ -275,12 +275,12 @@ class Widget
if (!$cid) {
if (Profile::getMyURL()) {
$contact = dba::selectFirst('contact', ['id'],
$contact = DBA::selectFirst('contact', ['id'],
['nurl' => normalise_link(Profile::getMyURL()), 'uid' => $profile_uid]);
if (DBM::is_result($contact)) {
$cid = $contact['id'];
} else {
$gcontact = dba::selectFirst('gcontact', ['id'], ['nurl' => normalise_link(Profile::getMyURL())]);
$gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => normalise_link(Profile::getMyURL())]);
if (DBM::is_result($gcontact)) {
$zcid = $gcontact['id'];
}

View file

@ -8,7 +8,7 @@ namespace Friendica\Content\Widget;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Database\dba;
use Friendica\Database\DBA;
use Friendica\Database\DBM;
require_once 'include/dba.php';
@ -38,7 +38,7 @@ class TagCloud
$o = '';
$r = self::tagadelic($uid, $count, $owner_id, $flags, $type);
if (count($r)) {
$contact = dba::selectFirst('contact', ['url'], ['uid' => $uid, 'self' => true]);
$contact = DBA::selectFirst('contact', ['url'], ['uid' => $uid, 'self' => true]);
$url = System::removedBaseUrl($contact['url']);
foreach ($r as $rr) {
@ -88,7 +88,7 @@ class TagCloud
}
// Fetch tags
$r = dba::p("SELECT `term`, COUNT(`term`) AS `total` FROM `term`
$r = DBA::p("SELECT `term`, COUNT(`term`) AS `total` FROM `term`
LEFT JOIN `item` ON `term`.`oid` = `item`.`id`
WHERE `term`.`uid` = ? AND `term`.`type` = ?
AND `term`.`otype` = ?