mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
Rename Friendica\Database\dba to Friendica\Database\DBA
This commit is contained in:
parent
b6a1df0598
commit
af6dbc654f
127 changed files with 1169 additions and 1169 deletions
|
@ -7,7 +7,7 @@ namespace Friendica\Network;
|
|||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\dba;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use OAuthServer;
|
||||
|
@ -37,7 +37,7 @@ class FKOAuth1 extends OAuthServer
|
|||
{
|
||||
logger("FKOAuth1::loginUser $uid");
|
||||
$a = get_app();
|
||||
$record = dba::selectFirst('user', [], ['uid' => $uid, 'blocked' => 0, 'account_expired' => 0, 'account_removed' => 0, 'verified' => 1]);
|
||||
$record = DBA::selectFirst('user', [], ['uid' => $uid, 'blocked' => 0, 'account_expired' => 0, 'account_removed' => 0, 'verified' => 1]);
|
||||
|
||||
if (!DBM::is_result($record)) {
|
||||
logger('FKOAuth1::loginUser failure: ' . print_r($_SERVER, true), LOGGER_DEBUG);
|
||||
|
@ -60,14 +60,14 @@ class FKOAuth1 extends OAuthServer
|
|||
$a->timezone = $a->user['timezone'];
|
||||
}
|
||||
|
||||
$contact = dba::selectFirst('contact', [], ['uid' => $_SESSION['uid'], 'self' => 1]);
|
||||
$contact = DBA::selectFirst('contact', [], ['uid' => $_SESSION['uid'], 'self' => 1]);
|
||||
if (DBM::is_result($contact)) {
|
||||
$a->contact = $contact;
|
||||
$a->cid = $contact['id'];
|
||||
$_SESSION['cid'] = $a->cid;
|
||||
}
|
||||
|
||||
dba::update('user', ['login_date' => DateTimeFormat::utcNow()], ['uid' => $_SESSION['uid']]);
|
||||
DBA::update('user', ['login_date' => DateTimeFormat::utcNow()], ['uid' => $_SESSION['uid']]);
|
||||
|
||||
Addon::callHooks('logged_in', $a->user);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
namespace Friendica\Network;
|
||||
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Database\dba;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Database\DBM;
|
||||
use OAuthConsumer;
|
||||
use OAuthDataStore;
|
||||
|
@ -42,8 +42,8 @@ class FKOAuthDataStore extends OAuthDataStore
|
|||
{
|
||||
logger(__function__ . ":" . $consumer_key);
|
||||
|
||||
$s = dba::select('clients', ['client_id', 'pw', 'redirect_uri'], ['client_id' => $consumer_key]);
|
||||
$r = dba::inArray($s);
|
||||
$s = DBA::select('clients', ['client_id', 'pw', 'redirect_uri'], ['client_id' => $consumer_key]);
|
||||
$r = DBA::inArray($s);
|
||||
|
||||
if (DBM::is_result($r)) {
|
||||
return new OAuthConsumer($r[0]['client_id'], $r[0]['pw'], $r[0]['redirect_uri']);
|
||||
|
@ -62,8 +62,8 @@ class FKOAuthDataStore extends OAuthDataStore
|
|||
{
|
||||
logger(__function__ . ":" . $consumer . ", " . $token_type . ", " . $token);
|
||||
|
||||
$s = dba::select('tokens', ['id', 'secret', 'scope', 'expires', 'uid'], ['client_id' => $consumer->key, 'scope' => $token_type, 'id' => $token]);
|
||||
$r = dba::inArray($s);
|
||||
$s = DBA::select('tokens', ['id', 'secret', 'scope', 'expires', 'uid'], ['client_id' => $consumer->key, 'scope' => $token_type, 'id' => $token]);
|
||||
$r = DBA::inArray($s);
|
||||
|
||||
if (DBM::is_result($r)) {
|
||||
$ot = new OAuthToken($r[0]['id'], $r[0]['secret']);
|
||||
|
@ -85,7 +85,7 @@ class FKOAuthDataStore extends OAuthDataStore
|
|||
*/
|
||||
public function lookup_nonce($consumer, $token, $nonce, $timestamp)
|
||||
{
|
||||
$token = dba::selectFirst('tokens', ['id', 'secret'], ['client_id' => $consumer->key, 'id' => $nonce, 'expires' => $timestamp]);
|
||||
$token = DBA::selectFirst('tokens', ['id', 'secret'], ['client_id' => $consumer->key, 'id' => $nonce, 'expires' => $timestamp]);
|
||||
if (DBM::is_result($token)) {
|
||||
return new OAuthToken($token['id'], $token['secret']);
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ class FKOAuthDataStore extends OAuthDataStore
|
|||
$k = $consumer;
|
||||
}
|
||||
|
||||
$r = dba::insert(
|
||||
$r = DBA::insert(
|
||||
'tokens',
|
||||
[
|
||||
'id' => $key,
|
||||
|
@ -151,7 +151,7 @@ class FKOAuthDataStore extends OAuthDataStore
|
|||
if (is_null($verifier) || ($uverifier !== false)) {
|
||||
$key = self::genToken();
|
||||
$sec = self::genToken();
|
||||
$r = dba::insert(
|
||||
$r = DBA::insert(
|
||||
'tokens',
|
||||
[
|
||||
'id' => $key,
|
||||
|
@ -167,7 +167,7 @@ class FKOAuthDataStore extends OAuthDataStore
|
|||
}
|
||||
}
|
||||
|
||||
dba::delete('tokens', ['id' => $token->key]);
|
||||
DBA::delete('tokens', ['id' => $token->key]);
|
||||
|
||||
if (!is_null($ret) && !is_null($uverifier)) {
|
||||
Config::delete("oauth", $verifier);
|
||||
|
|
|
@ -13,7 +13,7 @@ use DOMDocument;
|
|||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\dba;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Protocol\Email;
|
||||
|
@ -415,7 +415,7 @@ class Probe
|
|||
|
||||
$condition = ['nurl' => normalise_link($data["url"])];
|
||||
|
||||
$old_fields = dba::selectFirst('gcontact', $fieldnames, $condition);
|
||||
$old_fields = DBA::selectFirst('gcontact', $fieldnames, $condition);
|
||||
|
||||
// When the gcontact doesn't exist, the value "true" will trigger an insert.
|
||||
// In difference to the public contacts we want to have every contact
|
||||
|
@ -428,7 +428,7 @@ class Probe
|
|||
$fields['created'] = DateTimeFormat::utcNow();
|
||||
}
|
||||
|
||||
dba::update('gcontact', $fields, $condition, $old_fields);
|
||||
DBA::update('gcontact', $fields, $condition, $old_fields);
|
||||
|
||||
$fields = ['name' => $data['name'],
|
||||
'nick' => $data['nick'],
|
||||
|
@ -466,13 +466,13 @@ class Probe
|
|||
// This won't trigger an insert. This is intended, since we only need
|
||||
// public contacts for everyone we store items from.
|
||||
// We don't need to store every contact on the planet.
|
||||
$old_fields = dba::selectFirst('contact', $fieldnames, $condition);
|
||||
$old_fields = DBA::selectFirst('contact', $fieldnames, $condition);
|
||||
|
||||
$fields['name-date'] = DateTimeFormat::utcNow();
|
||||
$fields['uri-date'] = DateTimeFormat::utcNow();
|
||||
$fields['success_update'] = DateTimeFormat::utcNow();
|
||||
|
||||
dba::update('contact', $fields, $condition, $old_fields);
|
||||
DBA::update('contact', $fields, $condition, $old_fields);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue