Rename DBA::is_result to DBA::isResult

This commit is contained in:
Hypolite Petovan 2018-07-21 08:46:04 -04:00 committed by Hypolite Petovan
parent 0ec44f3e8a
commit ecea7425f8
152 changed files with 765 additions and 765 deletions

View file

@ -132,7 +132,7 @@ class DFRN
dbesc($owner_nick)
);
if (! DBA::is_result($r)) {
if (! DBA::isResult($r)) {
logger(sprintf('No contact found for nickname=%d', $owner_nick), LOGGER_WARNING);
killme();
}
@ -168,7 +168,7 @@ class DFRN
intval($owner_id)
);
if (! DBA::is_result($r)) {
if (! DBA::isResult($r)) {
logger(sprintf('No contact found for uid=%d', $owner_id), LOGGER_WARNING);
killme();
}
@ -277,7 +277,7 @@ class DFRN
/// @TODO This hook can't work anymore
// Addon::callHooks('atom_feed', $atom);
if (!DBA::is_result($items) || $onlyheader) {
if (!DBA::isResult($items) || $onlyheader) {
$atom = trim($doc->saveXML());
Addon::callHooks('atom_feed_end', $atom);
@ -332,7 +332,7 @@ class DFRN
$ret = Item::select(Item::DELIVER_FIELDLIST, $condition);
$items = Item::inArray($ret);
if (!DBA::is_result($items)) {
if (!DBA::isResult($items)) {
killme();
}
@ -598,7 +598,7 @@ class DFRN
WHERE (`hidewall` OR NOT `net-publish`) AND `user`.`uid` = %d",
intval($owner['uid'])
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$hidewall = true;
} else {
$hidewall = false;
@ -657,7 +657,7 @@ class DFRN
WHERE `profile`.`is-default` AND NOT `user`.`hidewall` AND `user`.`uid` = %d",
intval($owner['uid'])
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$profile = $r[0];
XML::addElement($doc, $author, "poco:displayName", $profile["name"]);
@ -952,7 +952,7 @@ class DFRN
if (isset($parent_item)) {
$conversation = DBA::selectFirst('conversation', ['conversation-uri', 'conversation-href'], ['item-uri' => $item['parent-uri']]);
if (DBA::is_result($conversation)) {
if (DBA::isResult($conversation)) {
if ($conversation['conversation-uri'] != '') {
$conversation_uri = $conversation['conversation-uri'];
}
@ -1076,7 +1076,7 @@ class DFRN
dbesc(normalise_link($mention))
);
if (DBA::is_result($r) && ($r[0]["forum"] || $r[0]["prv"])) {
if (DBA::isResult($r) && ($r[0]["forum"] || $r[0]["prv"])) {
XML::addElement(
$doc,
$entry,
@ -1502,7 +1502,7 @@ class DFRN
dbesc('birthday')
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
return;
}
@ -1551,7 +1551,7 @@ class DFRN
$importer["importer_uid"], normalise_link($author["link"]), NETWORK_STATUSNET];
$contact_old = DBA::selectFirst('contact', $fields, $condition);
if (DBA::is_result($contact_old)) {
if (DBA::isResult($contact_old)) {
$author["contact-id"] = $contact_old["id"];
$author["network"] = $contact_old["network"];
} else {
@ -1594,7 +1594,7 @@ class DFRN
$author["avatar"] = current($avatarlist);
}
if (DBA::is_result($contact_old) && !$onlyfetch) {
if (DBA::isResult($contact_old) && !$onlyfetch) {
logger("Check if contact details for contact " . $contact_old["id"] . " (" . $contact_old["nick"] . ") have to be updated.", LOGGER_DEBUG);
$poco = ["url" => $contact_old["url"]];
@ -1926,7 +1926,7 @@ class DFRN
*
* @see https://github.com/friendica/friendica/pull/3254#discussion_r107315246
*/
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
return false;
}
@ -1939,7 +1939,7 @@ class DFRN
dbesc($suggest["name"]),
dbesc($suggest["request"])
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$fid = $r[0]["id"];
// OK, we do. Do we already have an introduction for this person ?
@ -1956,7 +1956,7 @@ class DFRN
*
* @see https://github.com/friendica/friendica/pull/3254#discussion_r107315246
*/
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
return false;
}
}
@ -1980,7 +1980,7 @@ class DFRN
* If no record in fcontact is found, below INSERT statement will not
* link an introduction to it.
*/
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
// Database record did not get created. Quietly give up.
killme();
}
@ -2066,7 +2066,7 @@ class DFRN
intval($importer["importer_uid"])
);
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
logger("Query failed to execute, no result returned in " . __FUNCTION__);
return false;
}
@ -2164,7 +2164,7 @@ class DFRN
$is_a_remote_action = false;
$parent = Item::selectFirst(['parent-uri'], ['uri' => $item["parent-uri"]]);
if (DBA::is_result($parent)) {
if (DBA::isResult($parent)) {
$r = q(
"SELECT `item`.`forum_mode`, `item`.`wall` FROM `item`
INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
@ -2177,7 +2177,7 @@ class DFRN
dbesc($parent["parent-uri"]),
intval($importer["importer_uid"])
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$is_a_remote_action = true;
}
}
@ -2336,7 +2336,7 @@ class DFRN
if ($xt->type == ACTIVITY_OBJ_NOTE) {
$item_tag = Item::selectFirst(['id', 'tag'], ['uri' => $xt->id, 'uid' => $importer["importer_uid"]]);
if (!DBA::is_result($item_tag)) {
if (!DBA::isResult($item_tag)) {
logger("Query failed to execute, no result returned in " . __FUNCTION__);
return false;
}
@ -2427,7 +2427,7 @@ class DFRN
['uri' => $item["uri"], 'uid' => $importer["importer_uid"]]
);
// Is there an existing item?
if (DBA::is_result($current) && !self::isEditedTimestampNewer($current, $item)) {
if (DBA::isResult($current) && !self::isEditedTimestampNewer($current, $item)) {
logger("Item ".$item["uri"]." (".$item['edited'].") already existed.", LOGGER_DEBUG);
return;
}
@ -2648,7 +2648,7 @@ class DFRN
dbesc($item["uri"]),
intval($importer["importer_uid"])
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$ev["id"] = $r[0]["id"];
}
@ -2672,7 +2672,7 @@ class DFRN
// Update content if 'updated' changes
if (DBA::is_result($current)) {
if (DBA::isResult($current)) {
if (self::updateContent($current, $item, $importer, $entrytype)) {
logger("Item ".$item["uri"]." was updated.", LOGGER_DEBUG);
} else {
@ -2764,7 +2764,7 @@ class DFRN
$condition = ['uri' => $uri, 'uid' => $importer["importer_uid"]];
$item = Item::selectFirst(['id', 'parent', 'contact-id', 'file', 'deleted'], $condition);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
logger("Item with uri " . $uri . " for user " . $importer["importer_uid"] . " wasn't found.", LOGGER_DEBUG);
return;
}
@ -2957,7 +2957,7 @@ class DFRN
dbesc($baseurl),
dbesc($nurl)
);
if ((! DBA::is_result($r)) || $r[0]['id'] == remote_user()) {
if ((! DBA::isResult($r)) || $r[0]['id'] == remote_user()) {
return;
}
@ -2968,7 +2968,7 @@ class DFRN
intval(local_user()),
dbesc($baseurl)
);
if (! DBA::is_result($r)) {
if (! DBA::isResult($r)) {
return;
}
@ -3035,7 +3035,7 @@ class DFRN
$u = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
intval($uid)
);
if (!DBA::is_result($u)) {
if (!DBA::isResult($u)) {
return false;
}

View file

@ -70,7 +70,7 @@ class Diaspora
if (Config::get("system", "relay_directly", false)) {
// We distribute our stuff based on the parent to ensure that the thread will be complete
$parent = Item::selectFirst(['parent'], ['id' => $item_id]);
if (!DBA::is_result($parent)) {
if (!DBA::isResult($parent)) {
return;
}
@ -147,7 +147,7 @@ class Diaspora
'contact-type' => ACCOUNT_TYPE_RELAY];
$contact = DBA::selectFirst('contact', $fields, $condition);
if (DBA::is_result($contact)) {
if (DBA::isResult($contact)) {
if ($contact['archive'] || $contact['blocked']) {
return false;
}
@ -156,7 +156,7 @@ class Diaspora
self::setRelayContact($server_url);
$contact = DBA::selectFirst('contact', $fields, $condition);
if (DBA::is_result($contact)) {
if (DBA::isResult($contact)) {
return $contact;
}
}
@ -899,7 +899,7 @@ class Diaspora
$update = false;
$person = DBA::selectFirst('fcontact', [], ['network' => NETWORK_DIASPORA, 'addr' => $handle]);
if (DBA::is_result($person)) {
if (DBA::isResult($person)) {
logger("In cache " . print_r($person, true), LOGGER_DEBUG);
// update record occasionally so it doesn't get stale
@ -913,7 +913,7 @@ class Diaspora
}
}
if (!DBA::is_result($person) || $update) {
if (!DBA::isResult($person) || $update) {
logger("create or refresh", LOGGER_DEBUG);
$r = Probe::uri($handle, NETWORK_DIASPORA);
@ -924,7 +924,7 @@ class Diaspora
// Fetch the updated or added contact
$person = DBA::selectFirst('fcontact', [], ['network' => NETWORK_DIASPORA, 'addr' => $handle]);
if (!DBA::is_result($person)) {
if (!DBA::isResult($person)) {
$person = $r;
}
}
@ -973,7 +973,7 @@ class Diaspora
intval($pcontact_id)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
return strtolower($r[0]["addr"]);
}
}
@ -983,7 +983,7 @@ class Diaspora
intval($contact_id)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$contact = $r[0];
logger("contact 'self' = ".$contact['self']." 'url' = ".$contact['url'], LOGGER_DEBUG);
@ -1020,7 +1020,7 @@ class Diaspora
dbesc($fcontact_guid)
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
return $r[0]['url'];
}
@ -1052,7 +1052,7 @@ class Diaspora
}
$contact = dba::selectFirst('contact', [], ['id' => $cid]);
if (!DBA::is_result($contact)) {
if (!DBA::isResult($contact)) {
// This here shouldn't happen at all
logger("Haven't found a contact for user " . $uid . " and handle " . $handle, LOGGER_DEBUG);
return false;
@ -1153,7 +1153,7 @@ class Diaspora
private static function messageExists($uid, $guid)
{
$item = Item::selectFirst(['id'], ['uid' => $uid, 'guid' => $guid]);
if (DBA::is_result($item)) {
if (DBA::isResult($item)) {
logger("message ".$guid." already exists for user ".$uid);
return $item["id"];
}
@ -1373,7 +1373,7 @@ class Diaspora
$condition = ['uid' => $uid, 'guid' => $guid];
$item = Item::selectFirst($fields, $condition);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
$result = self::storeByGuid($guid, $contact["url"], $uid);
if (!$result) {
@ -1388,7 +1388,7 @@ class Diaspora
}
}
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
logger("parent item not found: parent: ".$guid." - user: ".$uid);
return false;
} else {
@ -1412,7 +1412,7 @@ class Diaspora
{
$condition = ['nurl' => normalise_link($person["url"]), 'uid' => $uid];
$contact = DBA::selectFirst('contact', ['id', 'network'], $condition);
if (DBA::is_result($contact)) {
if (DBA::isResult($contact)) {
$cid = $contact["id"];
$network = $contact["network"];
} else {
@ -1568,7 +1568,7 @@ class Diaspora
private static function getUriFromGuid($author, $guid, $onlyfound = false)
{
$item = Item::selectFirst(['uri'], ['guid' => $guid]);
if (DBA::is_result($item)) {
if (DBA::isResult($item)) {
return $item["uri"];
} elseif (!$onlyfound) {
$contact = Contact::getDetailsByAddr($author, 0);
@ -1598,7 +1598,7 @@ class Diaspora
private static function getGuidFromUri($uri, $uid)
{
$item = Item::selectFirst(['guid'], ['uri' => $uri, 'uid' => $uid]);
if (DBA::is_result($item)) {
if (DBA::isResult($item)) {
return $item["guid"];
} else {
return false;
@ -1615,10 +1615,10 @@ class Diaspora
private static function importerForGuid($guid)
{
$item = Item::selectFirst(['uid'], ['origin' => true, 'guid' => $guid]);
if (DBA::is_result($item)) {
if (DBA::isResult($item)) {
logger("Found user ".$item['uid']." as owner of item ".$guid, LOGGER_DEBUG);
$contact = DBA::selectFirst('contact', [], ['self' => true, 'uid' => $item['uid']]);
if (DBA::is_result($contact)) {
if (DBA::isResult($contact)) {
return $contact;
}
}
@ -1790,7 +1790,7 @@ class Diaspora
dbesc($msg_guid),
intval($importer["uid"])
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
logger("duplicate message already delivered.", LOGGER_DEBUG);
return false;
}
@ -2077,7 +2077,7 @@ class Diaspora
dbesc($guid),
intval($importer["uid"])
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
logger("duplicate message already delivered.", LOGGER_DEBUG);
return false;
}
@ -2133,7 +2133,7 @@ class Diaspora
}
$item = Item::selectFirst(['id'], ['guid' => $parent_guid, 'origin' => true, 'private' => false]);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
logger('Item not found, no origin or private: '.$parent_guid);
return false;
}
@ -2517,7 +2517,7 @@ class Diaspora
$condition = ['guid' => $guid, 'visible' => true, 'deleted' => false, 'private' => false];
$item = Item::selectFirst($fields, $condition);
if (DBA::is_result($item)) {
if (DBA::isResult($item)) {
logger("reshared message ".$guid." already exists on system.");
// Maybe it is already a reshared item?
@ -2539,7 +2539,7 @@ class Diaspora
}
}
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
if (empty($orig_author)) {
logger('Empty author for guid ' . $guid . '. Quitting.');
return false;
@ -2561,7 +2561,7 @@ class Diaspora
$condition = ['guid' => $guid, 'visible' => true, 'deleted' => false, 'private' => false];
$item = Item::selectFirst($fields, $condition);
if (DBA::is_result($item)) {
if (DBA::isResult($item)) {
// If it is a reshared post from another network then reformat to avoid display problems with two share elements
if (self::isReshare($item["body"], false)) {
$item["body"] = Markdown::toBBCode(BBCode::toMarkdown($item["body"]));
@ -2703,7 +2703,7 @@ class Diaspora
}
$r = Item::select($fields, $condition);
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
logger("Target guid ".$target_guid." was not found on this system for user ".$importer['uid'].".");
return false;
}
@ -3356,7 +3356,7 @@ class Diaspora
if (($guid != "") && $complete) {
$condition = ['guid' => $guid, 'network' => [NETWORK_DFRN, NETWORK_DIASPORA]];
$item = Item::selectFirst(['contact-id'], $condition);
if (DBA::is_result($item)) {
if (DBA::isResult($item)) {
$ret= [];
$ret["root_handle"] = self::handleFromContact($item["contact-id"]);
$ret["root_guid"] = $guid;
@ -3409,7 +3409,7 @@ class Diaspora
private static function buildEvent($event_id)
{
$r = q("SELECT `guid`, `uid`, `start`, `finish`, `nofinish`, `summary`, `desc`, `location`, `adjust` FROM `event` WHERE `id` = %d", intval($event_id));
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
return [];
}
@ -3418,14 +3418,14 @@ class Diaspora
$eventdata = [];
$r = q("SELECT `timezone` FROM `user` WHERE `uid` = %d", intval($event['uid']));
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
return [];
}
$user = $r[0];
$r = q("SELECT `addr`, `nick` FROM `contact` WHERE `uid` = %d AND `self`", intval($event['uid']));
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
return [];
}
@ -3623,7 +3623,7 @@ class Diaspora
private static function constructLike(array $item, array $owner)
{
$parent = Item::selectFirst(['guid', 'uri', 'parent-uri'], ['uri' => $item["thr-parent"]]);
if (!DBA::is_result($parent)) {
if (!DBA::isResult($parent)) {
return false;
}
@ -3654,7 +3654,7 @@ class Diaspora
private static function constructAttend(array $item, array $owner)
{
$parent = Item::selectFirst(['guid', 'uri', 'parent-uri'], ['uri' => $item["thr-parent"]]);
if (!DBA::is_result($parent)) {
if (!DBA::isResult($parent)) {
return false;
}
@ -3698,7 +3698,7 @@ class Diaspora
}
$parent = Item::selectFirst(['guid'], ['id' => $item["parent"], 'parent' => $item["parent"]]);
if (!DBA::is_result($parent)) {
if (!DBA::isResult($parent)) {
return false;
}
@ -3924,7 +3924,7 @@ class Diaspora
intval($item["uid"])
);
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
logger("conversation not found.");
return;
}
@ -4164,14 +4164,14 @@ class Diaspora
}
$r = q("SELECT `prvkey` FROM `user` WHERE `uid` = %d LIMIT 1", intval($contact['uid']));
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
return false;
}
$contact["uprvkey"] = $r[0]['prvkey'];
$item = Item::selectFirst([], ['id' => $post_id]);
if (!DBA::is_result($item)) {
if (!DBA::isResult($item)) {
return false;
}

View file

@ -246,7 +246,7 @@ class Feed {
$condition = ["`uid` = ? AND `uri` = ? AND `network` IN (?, ?)",
$importer["uid"], $item["uri"], NETWORK_FEED, NETWORK_DFRN];
$previous = Item::selectFirst(['id'], $condition);
if (DBA::is_result($previous)) {
if (DBA::isResult($previous)) {
logger("Item with uri ".$item["uri"]." for user ".$importer["uid"]." already existed under id ".$previous["id"], LOGGER_DEBUG);
continue;
}

View file

@ -80,7 +80,7 @@ class OStatus
$contact = DBA::selectFirst('contact', [], $condition);
}
if (!DBA::is_result($contact) && $author["author-link"] != '') {
if (!DBA::isResult($contact) && $author["author-link"] != '') {
if ($aliaslink == "") {
$aliaslink = $author["author-link"];
}
@ -91,14 +91,14 @@ class OStatus
$contact = DBA::selectFirst('contact', [], $condition);
}
if (!DBA::is_result($contact) && ($addr != '')) {
if (!DBA::isResult($contact) && ($addr != '')) {
$condition = ["`uid` = ? AND `addr` = ? AND `network` != ? AND `rel` IN (?, ?)",
$importer["uid"], $addr, NETWORK_STATUSNET,
CONTACT_IS_SHARING, CONTACT_IS_FRIEND];
$contact = DBA::selectFirst('contact', [], $condition);
}
if (DBA::is_result($contact)) {
if (DBA::isResult($contact)) {
if ($contact['blocked']) {
$contact['id'] = -1;
}
@ -135,7 +135,7 @@ class OStatus
$author["owner-id"] = $author["author-id"];
// Only update the contacts if it is an OStatus contact
if (DBA::is_result($contact) && ($contact['id'] > 0) && !$onlyfetch && ($contact["network"] == NETWORK_OSTATUS)) {
if (DBA::isResult($contact) && ($contact['id'] > 0) && !$onlyfetch && ($contact["network"] == NETWORK_OSTATUS)) {
// Update contact data
$current = $contact;
@ -896,7 +896,7 @@ class OStatus
{
$condition = ['`item-uri` = ? AND `protocol` IN (?, ?)', $related_uri, PROTOCOL_DFRN, PROTOCOL_OSTATUS_SALMON];
$conversation = DBA::selectFirst('conversation', ['source', 'protocol'], $condition);
if (DBA::is_result($conversation)) {
if (DBA::isResult($conversation)) {
$stored = true;
$xml = $conversation['source'];
if (self::process($xml, $importer, $contact, $hub, $stored, false)) {
@ -976,7 +976,7 @@ class OStatus
if ($xml == '') {
$condition = ['item-uri' => $related_uri, 'protocol' => PROTOCOL_SPLITTED_CONV];
$conversation = DBA::selectFirst('conversation', ['source'], $condition);
if (DBA::is_result($conversation)) {
if (DBA::isResult($conversation)) {
$stored = true;
logger('Got cached XML from conversation for URI '.$related_uri, LOGGER_DEBUG);
$xml = $conversation['source'];
@ -1452,7 +1452,7 @@ class OStatus
}
}
if (DBA::is_result($profile) && !$show_profile) {
if (DBA::isResult($profile) && !$show_profile) {
if (trim($profile["homepage"]) != "") {
$urls = $doc->createElement("poco:urls");
XML::addElement($doc, $urls, "poco:type", "homepage");
@ -1576,24 +1576,24 @@ class OStatus
dbesc(normalise_link($url)),
intval($owner["uid"])
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$contact = $r[0];
$contact["uid"] = -1;
}
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
$r = q(
"SELECT * FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
dbesc(normalise_link($url))
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$contact = $r[0];
$contact["uid"] = -1;
$contact["success_update"] = $contact["updated"];
}
}
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
$contact = owner;
}
@ -1635,7 +1635,7 @@ class OStatus
$condition = ['uid' => $owner["uid"], 'guid' => $repeated_guid, 'private' => false,
'network' => [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS]];
$repeated_item = Item::selectFirst([], $condition);
if (!DBA::is_result($repeated_item)) {
if (!DBA::isResult($repeated_item)) {
return false;
}
@ -1793,7 +1793,7 @@ class OStatus
dbesc(normalise_link($contact["url"]))
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
$connect_id = $r[0]['id'];
} else {
$connect_id = 0;
@ -1962,7 +1962,7 @@ class OStatus
$thrparent = Item::selectFirst(['guid', 'author-link', 'owner-link', 'plink'], ['uid' => $owner["uid"], 'uri' => $parent_item]);
if (DBA::is_result($thrparent)) {
if (DBA::isResult($thrparent)) {
$mentioned[$thrparent["author-link"]] = $thrparent["author-link"];
$mentioned[$thrparent["owner-link"]] = $thrparent["owner-link"];
$parent_plink = $thrparent["plink"];
@ -1989,7 +1989,7 @@ class OStatus
if (isset($parent_item)) {
$conversation = DBA::selectFirst('conversation', ['conversation-uri', 'conversation-href'], ['item-uri' => $parent_item]);
if (DBA::is_result($conversation)) {
if (DBA::isResult($conversation)) {
if ($conversation['conversation-uri'] != '') {
$conversation_uri = $conversation['conversation-uri'];
}

View file

@ -67,7 +67,7 @@ class PortableContact
if ($cid) {
if (!$url || !$uid) {
$contact = DBA::selectFirst('contact', ['poco', 'uid'], ['id' => $cid]);
if (DBA::is_result($contact)) {
if (DBA::isResult($contact)) {
$url = $contact['poco'];
$uid = $contact['uid'];
}
@ -284,7 +284,7 @@ class PortableContact
dbesc(normalise_link($server_url))
);
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
return $server_url;
}
@ -309,7 +309,7 @@ class PortableContact
dbesc(normalise_link($profile))
);
if (!DBA::is_result($gcontacts)) {
if (!DBA::isResult($gcontacts)) {
return false;
}
@ -930,7 +930,7 @@ class PortableContact
}
$gserver = DBA::selectFirst('gserver', [], ['nurl' => normalise_link($server_url)]);
if (DBA::is_result($gserver)) {
if (DBA::isResult($gserver)) {
if ($gserver["created"] <= NULL_DATE) {
$fields = ['created' => DateTimeFormat::utcNow()];
$condition = ['nurl' => normalise_link($server_url)];
@ -1001,7 +1001,7 @@ class PortableContact
// Quit if there is a timeout.
// But we want to make sure to only quit if we are mostly sure that this server url fits.
if (DBA::is_result($gserver) && ($orig_server_url == $server_url) &&
if (DBA::isResult($gserver) && ($orig_server_url == $server_url) &&
(!empty($serverret["errno"]) && ($serverret['errno'] == CURLE_OPERATION_TIMEDOUT))) {
logger("Connection to server ".$server_url." timed out.", LOGGER_DEBUG);
DBA::update('gserver', ['last_failure' => DateTimeFormat::utcNow()], ['nurl' => normalise_link($server_url)]);
@ -1420,7 +1420,7 @@ class PortableContact
}
$gserver = DBA::selectFirst('gserver', ['id', 'relay-subscribe', 'relay-scope'], ['nurl' => normalise_link($server_url)]);
if (!DBA::is_result($gserver)) {
if (!DBA::isResult($gserver)) {
return;
}
@ -1482,7 +1482,7 @@ class PortableContact
dbesc(NETWORK_OSTATUS)
);
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
return false;
}
@ -1510,7 +1510,7 @@ class PortableContact
$server_url = str_replace("/index.php", "", $server->url);
$r = q("SELECT `nurl` FROM `gserver` WHERE `nurl` = '%s'", dbesc(normalise_link($server_url)));
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
logger("Call server check for server ".$server_url, LOGGER_DEBUG);
Worker::add(PRIORITY_LOW, "DiscoverPoCo", "server", $server_url);
}
@ -1579,7 +1579,7 @@ class PortableContact
public static function discoverSingleServer($id)
{
$r = q("SELECT `poco`, `nurl`, `url`, `network` FROM `gserver` WHERE `id` = %d", intval($id));
if (!DBA::is_result($r)) {
if (!DBA::isResult($r)) {
return false;
}
@ -1655,7 +1655,7 @@ class PortableContact
$last_update = date("c", time() - (60 * 60 * 24 * $requery_days));
$r = q("SELECT `id`, `url`, `nurl`, `network` FROM `gserver` WHERE `last_contact` >= `last_failure` AND `poco` != '' AND `last_poco_query` < '%s' ORDER BY RAND()", dbesc($last_update));
if (DBA::is_result($r)) {
if (DBA::isResult($r)) {
foreach ($r as $server) {
if (!self::checkServer($server["url"], $server["network"])) {
// The server is not reachable? Okay, then we will try it later