mirror of
https://github.com/friendica/friendica
synced 2025-04-19 06:30:10 +00:00
Replace BaseObject class with DI::* calls
This commit is contained in:
parent
1de3f186d7
commit
388b963714
98 changed files with 321 additions and 440 deletions
|
@ -7,12 +7,10 @@
|
|||
*/
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\BaseObject;
|
||||
use Friendica\Content\ContactSelector;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Content\Text\HTML;
|
||||
use Friendica\App\Authentication;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
|
@ -23,11 +21,11 @@ use Friendica\Core\Session;
|
|||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Group;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Mail;
|
||||
use Friendica\Model\Notify;
|
||||
use Friendica\Model\Photo;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Model\User;
|
||||
|
@ -254,9 +252,7 @@ function api_login(App $a)
|
|||
throw new UnauthorizedException("This API requires login");
|
||||
}
|
||||
|
||||
/** @var Authentication $authentication */
|
||||
$authentication = BaseObject::getClass(Authentication::class);
|
||||
$authentication->setForUser($a, $record);
|
||||
DI::auth()->setForUser($a, $record);
|
||||
|
||||
$_SESSION["allow_api"] = true;
|
||||
|
||||
|
@ -5909,10 +5905,7 @@ function api_friendica_notification($type)
|
|||
if ($a->argc!==3) {
|
||||
throw new BadRequestException("Invalid argument count");
|
||||
}
|
||||
/** @var Notify $nm */
|
||||
$nm = BaseObject::getClass(Notify::class);
|
||||
|
||||
$notes = $nm->getAll([], ['seen' => 'ASC', 'date' => 'DESC'], 50);
|
||||
$notes = DI::notify()->getAll([], ['seen' => 'ASC', 'date' => 'DESC'], 50);
|
||||
|
||||
if ($type == "xml") {
|
||||
$xmlnotes = [];
|
||||
|
@ -5954,8 +5947,7 @@ function api_friendica_notification_seen($type)
|
|||
|
||||
$id = (!empty($_REQUEST['id']) ? intval($_REQUEST['id']) : 0);
|
||||
|
||||
/** @var Notify $nm */
|
||||
$nm = BaseObject::getClass(Notify::class);
|
||||
$nm = DI::notify();
|
||||
$note = $nm->getByID($id);
|
||||
if (is_null($note)) {
|
||||
throw new BadRequestException("Invalid argument");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue