Merge pull request #8019 from nupplaphil/task/replace_getClass

Introduce new way of static/dynamic bridge / CleanUp deprecated methods
This commit is contained in:
Hypolite Petovan 2019-12-29 17:47:28 -05:00 committed by GitHub
commit 03038e7a3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
264 changed files with 1631 additions and 1854 deletions

View file

@ -4,11 +4,9 @@
*/
namespace Friendica\Network;
use Friendica\BaseObject;
use Friendica\App\Authentication;
use Friendica\Core\Logger;
use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use OAuthServer;
use OAuthSignatureMethod_HMAC_SHA1;
use OAuthSignatureMethod_PLAINTEXT;
@ -37,7 +35,7 @@ class FKOAuth1 extends OAuthServer
public function loginUser($uid)
{
Logger::log("FKOAuth1::loginUser $uid");
$a = BaseObject::getApp();
$a = DI::app();
$record = DBA::selectFirst('user', [], ['uid' => $uid, 'blocked' => 0, 'account_expired' => 0, 'account_removed' => 0, 'verified' => 1]);
if (!DBA::isResult($record)) {
@ -46,8 +44,6 @@ class FKOAuth1 extends OAuthServer
die('This api requires login');
}
/** @var Authentication $authentication */
$authentication = BaseObject::getClass(Authentication::class);
$authentication->setForUser($a, $record, true);
DI::auth()->setForUser($a, $record, true);
}
}

View file

@ -17,6 +17,7 @@ use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Protocol\ActivityNamespace;
@ -76,7 +77,7 @@ class Probe
*/
private static function ownHost($host)
{
$own_host = \get_app()->getHostName();
$own_host = DI::baseUrl()->getHostname();
$parts = parse_url($host);