mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-10 09:04:26 +02:00
Rename DBA::is_result to DBA::isResult
This commit is contained in:
parent
0ec44f3e8a
commit
ecea7425f8
152 changed files with 765 additions and 765 deletions
|
@ -112,7 +112,7 @@ class ACL extends BaseObject
|
|||
// e.g. 'network_pre_contact_deny', 'profile_pre_contact_allow'
|
||||
Addon::callHooks($a->module . '_pre_' . $selname, $arr);
|
||||
|
||||
if (DBA::is_result($contacts)) {
|
||||
if (DBA::isResult($contacts)) {
|
||||
foreach ($contacts as $contact) {
|
||||
if (in_array($contact['id'], $preselected)) {
|
||||
$selected = ' selected="selected" ';
|
||||
|
@ -179,7 +179,7 @@ class ACL extends BaseObject
|
|||
|
||||
$receiverlist = [];
|
||||
|
||||
if (DBA::is_result($contacts)) {
|
||||
if (DBA::isResult($contacts)) {
|
||||
foreach ($contacts as $contact) {
|
||||
if (in_array($contact['id'], $preselected)) {
|
||||
$selected = ' selected="selected"';
|
||||
|
@ -273,7 +273,7 @@ class ACL extends BaseObject
|
|||
|
||||
if (!$imap_disabled) {
|
||||
$mailacct = DBA::selectFirst('mailacct', ['pubmail'], ['`uid` = ? AND `server` != ""', local_user()]);
|
||||
if (DBA::is_result($mailacct)) {
|
||||
if (DBA::isResult($mailacct)) {
|
||||
$mail_enabled = true;
|
||||
$pubmail_enabled = !empty($mailacct['pubmail']);
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ class Addon
|
|||
$addons = Config::get('system', 'addon');
|
||||
if (strlen($addons)) {
|
||||
$r = DBA::select('addon', [], ['installed' => 1]);
|
||||
if (DBA::is_result($r)) {
|
||||
if (DBA::isResult($r)) {
|
||||
$installed = DBA::toArray($r);
|
||||
} else {
|
||||
$installed = [];
|
||||
|
|
|
@ -17,7 +17,7 @@ class DatabaseCacheDriver extends AbstractCacheDriver implements ICacheDriver
|
|||
{
|
||||
$cache = DBA::selectFirst('cache', ['v'], ['`k` = ? AND `expires` >= ?', $key, DateTimeFormat::utcNow()]);
|
||||
|
||||
if (DBA::is_result($cache)) {
|
||||
if (DBA::isResult($cache)) {
|
||||
$cached = $cache['v'];
|
||||
$value = @unserialize($cached);
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ class JITConfigAdapter extends BaseObject implements IConfigAdapter
|
|||
}
|
||||
|
||||
$config = DBA::selectFirst('config', ['v'], ['cat' => $cat, 'k' => $k]);
|
||||
if (DBA::is_result($config)) {
|
||||
if (DBA::isResult($config)) {
|
||||
// manage array value
|
||||
$value = (preg_match("|^a:[0-9]+:{.*}$|s", $config['v']) ? unserialize($config['v']) : $config['v']);
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ class JITPConfigAdapter extends BaseObject implements IPConfigAdapter
|
|||
$a = self::getApp();
|
||||
|
||||
$pconfigs = DBA::select('pconfig', ['v', 'k'], ['cat' => $cat, 'uid' => $uid]);
|
||||
if (DBA::is_result($pconfigs)) {
|
||||
if (DBA::isResult($pconfigs)) {
|
||||
while ($pconfig = DBA::fetch($pconfigs)) {
|
||||
$k = $pconfig['k'];
|
||||
|
||||
|
@ -58,7 +58,7 @@ class JITPConfigAdapter extends BaseObject implements IPConfigAdapter
|
|||
}
|
||||
|
||||
$pconfig = DBA::selectFirst('pconfig', ['v'], ['uid' => $uid, 'cat' => $cat, 'k' => $k]);
|
||||
if (DBA::is_result($pconfig)) {
|
||||
if (DBA::isResult($pconfig)) {
|
||||
$val = (preg_match("|^a:[0-9]+:{.*}$|s", $pconfig['v']) ? unserialize($pconfig['v']) : $pconfig['v']);
|
||||
|
||||
self::getApp()->setPConfigValue($uid, $cat, $k, $val);
|
||||
|
|
|
@ -43,7 +43,7 @@ class PreloadConfigAdapter extends BaseObject implements IConfigAdapter
|
|||
{
|
||||
if ($refresh) {
|
||||
$config = DBA::selectFirst('config', ['v'], ['cat' => $cat, 'k' => $k]);
|
||||
if (DBA::is_result($config)) {
|
||||
if (DBA::isResult($config)) {
|
||||
self::getApp()->setConfigValue($cat, $k, $config['v']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ class PreloadPConfigAdapter extends BaseObject implements IPConfigAdapter
|
|||
|
||||
if ($refresh) {
|
||||
$config = DBA::selectFirst('pconfig', ['v'], ['uid' => $uid, 'cat' => $cat, 'k' => $k]);
|
||||
if (DBA::is_result($config)) {
|
||||
if (DBA::isResult($config)) {
|
||||
self::getApp()->setPConfigValue($uid, $cat, $k, $config['v']);
|
||||
} else {
|
||||
self::getApp()->deletePConfigValue($uid, $cat, $k);
|
||||
|
|
|
@ -81,7 +81,7 @@ HELP;
|
|||
|
||||
$nurl = normalise_link($net['url']);
|
||||
$contact = DBA::selectFirst("contact", ["id"], ["nurl" => $nurl, "uid" => 0]);
|
||||
if (DBA::is_result($contact)) {
|
||||
if (DBA::isResult($contact)) {
|
||||
DBA::update("contact", ["hidden" => true], ["id" => $contact["id"]]);
|
||||
$this->out('NOTICE: The account should be silenced from the global community page');
|
||||
} else {
|
||||
|
|
|
@ -64,7 +64,7 @@ HELP;
|
|||
$nick = $this->getArgument(0);
|
||||
|
||||
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $nick]);
|
||||
if (!DBA::is_result($user)) {
|
||||
if (!DBA::isResult($user)) {
|
||||
throw new RuntimeException(L10n::t('User not found'));
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class DatabaseLockDriver extends AbstractLockDriver
|
|||
DBA::lock('locks');
|
||||
$lock = DBA::selectFirst('locks', ['locked', 'pid'], ['`name` = ? AND `expires` >= ?', $key, DateTimeFormat::utcNow()]);
|
||||
|
||||
if (DBA::is_result($lock)) {
|
||||
if (DBA::isResult($lock)) {
|
||||
if ($lock['locked']) {
|
||||
// We want to lock something that was already locked by us? So we got the lock.
|
||||
if ($lock['pid'] == getmypid()) {
|
||||
|
@ -79,7 +79,7 @@ class DatabaseLockDriver extends AbstractLockDriver
|
|||
{
|
||||
$lock = DBA::selectFirst('locks', ['locked'], ['`name` = ? AND `expires` >= ?', $key, DateTimeFormat::utcNow()]);
|
||||
|
||||
if (DBA::is_result($lock)) {
|
||||
if (DBA::isResult($lock)) {
|
||||
return $lock['locked'] !== false;
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -96,7 +96,7 @@ class NotificationsManager extends BaseObject
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if (DBA::is_result($r)) {
|
||||
if (DBA::isResult($r)) {
|
||||
return $this->_set_extra($r);
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ class NotificationsManager extends BaseObject
|
|||
intval($id),
|
||||
intval(local_user())
|
||||
);
|
||||
if (DBA::is_result($r)) {
|
||||
if (DBA::isResult($r)) {
|
||||
return $this->_set_extra($r)[0];
|
||||
}
|
||||
return null;
|
||||
|
@ -224,7 +224,7 @@ class NotificationsManager extends BaseObject
|
|||
$notif = [];
|
||||
$arr = [];
|
||||
|
||||
if (DBA::is_result($notifs)) {
|
||||
if (DBA::isResult($notifs)) {
|
||||
foreach ($notifs as $it) {
|
||||
// Because we use different db tables for the notification query
|
||||
// we have sometimes $it['unseen'] and sometimes $it['seen].
|
||||
|
@ -405,7 +405,7 @@ class NotificationsManager extends BaseObject
|
|||
|
||||
$items = Item::selectForUser(local_user(), $fields, $condition, $params);
|
||||
|
||||
if (DBA::is_result($items)) {
|
||||
if (DBA::isResult($items)) {
|
||||
$notifs = $this->formatNotifs(Item::inArray($items), $ident);
|
||||
}
|
||||
|
||||
|
@ -447,7 +447,7 @@ class NotificationsManager extends BaseObject
|
|||
intval($limit)
|
||||
);
|
||||
|
||||
if (DBA::is_result($r)) {
|
||||
if (DBA::isResult($r)) {
|
||||
$notifs = $this->formatNotifs($r, $ident);
|
||||
}
|
||||
|
||||
|
@ -492,7 +492,7 @@ class NotificationsManager extends BaseObject
|
|||
|
||||
$items = Item::selectForUser(local_user(), $fields, $condition, $params);
|
||||
|
||||
if (DBA::is_result($items)) {
|
||||
if (DBA::isResult($items)) {
|
||||
$notifs = $this->formatNotifs(Item::inArray($items), $ident);
|
||||
}
|
||||
|
||||
|
@ -532,7 +532,7 @@ class NotificationsManager extends BaseObject
|
|||
$params = ['order' => ['created' => true], 'limit' => [$start, $limit]];
|
||||
$items = Item::selectForUser(local_user(), $fields, $condition, $params);
|
||||
|
||||
if (DBA::is_result($items)) {
|
||||
if (DBA::isResult($items)) {
|
||||
$notifs = $this->formatNotifs(Item::inArray($items), $ident);
|
||||
}
|
||||
|
||||
|
@ -584,7 +584,7 @@ class NotificationsManager extends BaseObject
|
|||
intval($start),
|
||||
intval($limit)
|
||||
);
|
||||
if (DBA::is_result($r)) {
|
||||
if (DBA::isResult($r)) {
|
||||
$notifs = $this->formatIntros($r);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ class DatabaseSessionHandler extends BaseObject implements SessionHandlerInterfa
|
|||
}
|
||||
|
||||
$session = DBA::selectFirst('session', ['data'], ['sid' => $session_id]);
|
||||
if (DBA::is_result($session)) {
|
||||
if (DBA::isResult($session)) {
|
||||
Session::$exists = true;
|
||||
return $session['data'];
|
||||
}
|
||||
|
|
|
@ -162,7 +162,7 @@ class Worker
|
|||
{
|
||||
$condition = ["`executed` <= ? AND NOT `done`", NULL_DATE];
|
||||
$workerqueue = DBA::selectFirst('workerqueue', ['priority'], $condition, ['order' => ['priority']]);
|
||||
if (DBA::is_result($workerqueue)) {
|
||||
if (DBA::isResult($workerqueue)) {
|
||||
return $workerqueue["priority"];
|
||||
} else {
|
||||
return 0;
|
||||
|
@ -477,7 +477,7 @@ class Worker
|
|||
if ($max == 0) {
|
||||
// the maximum number of possible user connections can be a system variable
|
||||
$r = DBA::fetchFirst("SHOW VARIABLES WHERE `variable_name` = 'max_user_connections'");
|
||||
if (DBA::is_result($r)) {
|
||||
if (DBA::isResult($r)) {
|
||||
$max = $r["Value"];
|
||||
}
|
||||
// Or it can be granted. This overrides the system variable
|
||||
|
@ -513,7 +513,7 @@ class Worker
|
|||
// We will now check for the system values.
|
||||
// This limit could be reached although the user limits are fine.
|
||||
$r = DBA::fetchFirst("SHOW VARIABLES WHERE `variable_name` = 'max_connections'");
|
||||
if (!DBA::is_result($r)) {
|
||||
if (!DBA::isResult($r)) {
|
||||
return false;
|
||||
}
|
||||
$max = intval($r["Value"]);
|
||||
|
@ -521,7 +521,7 @@ class Worker
|
|||
return false;
|
||||
}
|
||||
$r = DBA::fetchFirst("SHOW STATUS WHERE `variable_name` = 'Threads_connected'");
|
||||
if (!DBA::is_result($r)) {
|
||||
if (!DBA::isResult($r)) {
|
||||
return false;
|
||||
}
|
||||
$used = intval($r["Value"]);
|
||||
|
@ -734,7 +734,7 @@ class Worker
|
|||
);
|
||||
|
||||
// No active processes at all? Fine
|
||||
if (!DBA::is_result($r)) {
|
||||
if (!DBA::isResult($r)) {
|
||||
return false;
|
||||
}
|
||||
$priorities = [];
|
||||
|
@ -871,7 +871,7 @@ class Worker
|
|||
|
||||
// There can already be jobs for us in the queue.
|
||||
$r = DBA::select('workerqueue', [], ['pid' => getmypid(), 'done' => false]);
|
||||
if (DBA::is_result($r)) {
|
||||
if (DBA::isResult($r)) {
|
||||
self::$db_duration += (microtime(true) - $stamp);
|
||||
return DBA::toArray($r);
|
||||
}
|
||||
|
@ -1163,7 +1163,7 @@ class Worker
|
|||
$row = DBA::selectFirst('worker-ipc', ['jobs'], ['key' => 1]);
|
||||
|
||||
// When we don't have a row, no job is running
|
||||
if (!DBA::is_result($row)) {
|
||||
if (!DBA::isResult($row)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue