From 2bbfc0640f411f99e37d82763ce57af5c0c18bd9 Mon Sep 17 00:00:00 2001 From: Adam Magness Date: Mon, 4 Dec 2017 15:59:21 -0500 Subject: [PATCH] Move to Network Move to network namespace. Get rid of q() and try to get used to [ ] instead of array() --- src/{Protocol => Network}/FKOAuth1.php | 9 +++------ src/{Protocol => Network}/FKOAuthDataStore.php | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) rename src/{Protocol => Network}/FKOAuth1.php (90%) rename src/{Protocol => Network}/FKOAuthDataStore.php (99%) diff --git a/src/Protocol/FKOAuth1.php b/src/Network/FKOAuth1.php similarity index 90% rename from src/Protocol/FKOAuth1.php rename to src/Network/FKOAuth1.php index 710097ae00..a323f5cd56 100644 --- a/src/Protocol/FKOAuth1.php +++ b/src/Network/FKOAuth1.php @@ -2,13 +2,13 @@ /** * @file src/Protocol/OAuth1.php */ -namespace Friendica\Protocol; +namespace Friendica\Network; use Friendica\App; use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Database\DBM; -use Friendica\Protocol\FKOAuthDataStore; +use Friendica\Network\FKOAuthDataStore; use dba; require_once "library/OAuth1.php"; @@ -70,10 +70,7 @@ class FKOAuth1 extends OAuthServer $_SESSION['cid'] = $a->cid; } - dba::q("UPDATE `user` SET `login_date` = '%s' WHERE `uid` = %d", - dbesc(datetime_convert()), - intval($_SESSION['uid']) - ); + dba::update('user', ['login_date' => datetime_convert()], ['uid' => $_SESSION['uid']]); call_hooks('logged_in', $a->user); } diff --git a/src/Protocol/FKOAuthDataStore.php b/src/Network/FKOAuthDataStore.php similarity index 99% rename from src/Protocol/FKOAuthDataStore.php rename to src/Network/FKOAuthDataStore.php index dc4b774b9b..007908b99b 100644 --- a/src/Protocol/FKOAuthDataStore.php +++ b/src/Network/FKOAuthDataStore.php @@ -5,7 +5,7 @@ * Based on oauth2-php * */ -namespace Friendica\Protocol; +namespace Friendica\Network; use Friendica\App; use Friendica\Core\Config; -- 2.39.5