mirror of
https://github.com/friendica/friendica
synced 2025-04-19 09:50:11 +00:00
Introduce new DI container
- Adding Friendica\DI class for getting dynamic classes - Replacing BaseObject::getApp() with this class
This commit is contained in:
parent
a9220aa83b
commit
1de3f186d7
132 changed files with 377 additions and 270 deletions
|
@ -8,6 +8,7 @@ use Friendica\BaseModule;
|
|||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Util\HTTPSignature;
|
||||
use Friendica\Util\Network;
|
||||
|
@ -22,7 +23,7 @@ class Magic extends BaseModule
|
|||
{
|
||||
public static function init(array $parameters = [])
|
||||
{
|
||||
$a = self::getApp();
|
||||
$a = DI::app();
|
||||
$ret = ['success' => false, 'url' => '', 'message' => ''];
|
||||
Logger::log('magic mdule: invoked', Logger::DEBUG);
|
||||
|
||||
|
@ -48,7 +49,7 @@ class Magic extends BaseModule
|
|||
$contact = DBA::selectFirst('contact', ['id', 'nurl', 'url'], ['id' => $cid]);
|
||||
|
||||
// Redirect if the contact is already authenticated on this site.
|
||||
if (!empty($a->contact) && array_key_exists('id', $a->contact) && strpos($contact['nurl'], Strings::normaliseLink(self::getApp()->getBaseURL())) !== false) {
|
||||
if (!empty($a->contact) && array_key_exists('id', $a->contact) && strpos($contact['nurl'], Strings::normaliseLink(DI::app()->getBaseURL())) !== false) {
|
||||
if ($test) {
|
||||
$ret['success'] = true;
|
||||
$ret['message'] .= 'Local site - you are already authenticated.' . EOL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue