mirror of
https://github.com/friendica/friendica
synced 2025-05-05 23:04:09 +02:00
Replace dba::select(limit => 1) by dba::selectOne
- Convert array declarations to new style
This commit is contained in:
parent
a2d3cee006
commit
da60893590
51 changed files with 206 additions and 219 deletions
|
@ -39,7 +39,7 @@ class Expire {
|
|||
}
|
||||
return;
|
||||
} elseif (intval($param) > 0) {
|
||||
$user = dba::select('user', array('uid', 'username', 'expire'), array('uid' => $param), array('limit' => 1));
|
||||
$user = dba::selectOne('user', ['uid', 'username', 'expire'], ['uid' => $param]);
|
||||
if (DBM::is_result($user)) {
|
||||
logger('Expire items for user '.$user['uid'].' ('.$user['username'].') - interval: '.$user['expire'], LOGGER_DEBUG);
|
||||
item_expire($user['uid'], $user['expire']);
|
||||
|
|
|
@ -265,9 +265,9 @@ class Notifier {
|
|||
($owner['id'] != $target_item['contact-id']) &&
|
||||
($target_item['uri'] === $target_item['parent-uri'])) {
|
||||
|
||||
$fields = array('forum', 'prv');
|
||||
$condition = array('id' => $target_item['contact-id']);
|
||||
$contact = dba::select('contact', $fields, $condition, array('limit' => 1));
|
||||
$fields = ['forum', 'prv'];
|
||||
$condition = ['id' => $target_item['contact-id']];
|
||||
$contact = dba::selectOne('contact', $fields, $condition);
|
||||
if (!DBM::is_result($contact)) {
|
||||
// Should never happen
|
||||
return false;
|
||||
|
|
|
@ -42,7 +42,7 @@ Class OnePoll
|
|||
|
||||
$d = datetime_convert();
|
||||
|
||||
$contact = dba::select('contact', [], ['id' => $contact_id], ['limit' => 1]);
|
||||
$contact = dba::selectOne('contact', [], ['id' => $contact_id]);
|
||||
if (!DBM::is_result($contact)) {
|
||||
logger('Contact not found or cannot be used.');
|
||||
return;
|
||||
|
@ -339,14 +339,14 @@ Class OnePoll
|
|||
logger("Mail: Enabled", LOGGER_DEBUG);
|
||||
|
||||
$mbox = null;
|
||||
$x = dba::select('user', array('prvkey'), array('uid' => $importer_uid), array('limit' => 1));
|
||||
$user = dba::selectOne('user', ['prvkey'], ['uid' => $importer_uid]);
|
||||
|
||||
$condition = array("`server` != '' AND `uid` = ?", $importer_uid);
|
||||
$mailconf = dba::select('mailacct', array(), $condition, array('limit' => 1));
|
||||
if (DBM::is_result($x) && DBM::is_result($mailconf)) {
|
||||
$condition = ["`server` != '' AND `uid` = ?", $importer_uid];
|
||||
$mailconf = dba::selectOne('mailacct', [], $condition);
|
||||
if (DBM::is_result($user) && DBM::is_result($mailconf)) {
|
||||
$mailbox = Email::constructMailboxName($mailconf);
|
||||
$password = '';
|
||||
openssl_private_decrypt(hex2bin($mailconf['pass']), $password, $x['prvkey']);
|
||||
openssl_private_decrypt(hex2bin($mailconf['pass']), $password, $user['prvkey']);
|
||||
$mbox = Email::connect($mailbox, $mailconf['user'], $password);
|
||||
unset($password);
|
||||
logger("Mail: Connect to " . $mailconf['user']);
|
||||
|
@ -382,9 +382,9 @@ Class OnePoll
|
|||
$datarray['uri'] = Email::msgid2iri(trim($meta->message_id, '<>'));
|
||||
|
||||
// Have we seen it before?
|
||||
$fields = array('deleted', 'id');
|
||||
$condition = array('uid' => $importer_uid, 'uri' => $datarray['uri']);
|
||||
$r = dba::select('item', $fields, $condition, array('limit' => 1));
|
||||
$fields = ['deleted', 'id'];
|
||||
$condition = ['uid' => $importer_uid, 'uri' => $datarray['uri']];
|
||||
$r = dba::selectOne('item', $fields, $condition);
|
||||
|
||||
if (DBM::is_result($r)) {
|
||||
logger("Mail: Seen before ".$msg_uid." for ".$mailconf['user']." UID: ".$importer_uid." URI: ".$datarray['uri'],LOGGER_DEBUG);
|
||||
|
|
|
@ -80,7 +80,7 @@ class Queue
|
|||
|
||||
$q_item = $r[0];
|
||||
|
||||
$contact = dba::select('contact', [], ['id' => $q_item['cid']], ['limit' => 1]);
|
||||
$contact = dba::selectOne('contact', [], ['id' => $q_item['cid']]);
|
||||
if (!DBM::is_result($contact)) {
|
||||
remove_queue_item($q_item['id']);
|
||||
return;
|
||||
|
@ -113,7 +113,7 @@ class Queue
|
|||
}
|
||||
}
|
||||
|
||||
$user = dba::select('user', [], ['uid' => $contact['uid']], ['limit' => 1]);
|
||||
$user = dba::selectOne('user', [], ['uid' => $contact['uid']]);
|
||||
if (!DBM::is_result($user)) {
|
||||
remove_queue_item($q_item['id']);
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue