X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FDI.php;h=4f950bd78eeea17db42c73b61cb35b14a7984490;hb=94439a3b429dd9312dcb3aa8ee8f20df7ff6281c;hp=b758ddab0bb84bd301111f95c26230c935da1edc;hpb=38f70cc55ad1d99b011fa92b42361c39ecceb2e3;p=friendica.git diff --git a/src/DI.php b/src/DI.php index b758ddab0b..4f950bd78e 100644 --- a/src/DI.php +++ b/src/DI.php @@ -98,14 +98,6 @@ abstract class DI return self::$dice->create(App\Mode::class); } - /** - * @return App\Module - */ - public static function module() - { - return self::$dice->create(App\Module::class); - } - /** * @return App\Page */ @@ -230,6 +222,18 @@ abstract class DI // "LoggerInterface" instances // + /** + * Flushes the Logger instance, so the factory is called again + * (creates a new id and retrieves the current PID) + */ + public static function flushLogger() + { + $flushDice = self::$dice + ->addRule(LoggerInterface::class, self::$dice->getRule(LoggerInterface::class)) + ->addRule('$devLogger', self::$dice->getRule('$devLogger')); + static::init($flushDice); + } + /** * @return LoggerInterface */ @@ -258,6 +262,14 @@ abstract class DI // "Factory" namespace instances // + /** + * @return Factory\Api\Friendica\Activities + */ + public static function friendicaActivities() + { + return self::$dice->create(Factory\Api\Friendica\Activities::class); + } + /** * @return Factory\Api\Mastodon\Account */ @@ -370,6 +382,14 @@ abstract class DI return self::$dice->create(Factory\Api\Mastodon\Notification::class); } + /** + * @return Factory\Api\Twitter\Status + */ + public static function twitterStatus() + { + return self::$dice->create(Factory\Api\Twitter\Status::class); + } + /** * @return Factory\Api\Twitter\User */ @@ -378,6 +398,14 @@ abstract class DI return self::$dice->create(Factory\Api\Twitter\User::class); } + /** + * @return Factory\Api\Twitter\DirectMessage + */ + public static function twitterDirectMessage() + { + return self::$dice->create(Factory\Api\Twitter\DirectMessage::class); + } + public static function notificationIntro(): Navigation\Notifications\Factory\Introduction { return self::$dice->create(Navigation\Notifications\Factory\Introduction::class); @@ -418,6 +446,15 @@ abstract class DI return self::$dice->create(Model\Log\ParsedLogIterator::class); } + // + // "Module" namespace + // + + public static function apiResponse(): Module\Api\ApiResponse + { + return self::$dice->create(Module\Api\ApiResponse::class); + } + // // "Network" namespace //