X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FDI.php;h=0c134f37b48cbf38c4b96cfc117469f6dc11707e;hb=efe5d641a274e99bf8b4dbcaaae1d9d4dd6bff10;hp=b758ddab0bb84bd301111f95c26230c935da1edc;hpb=38f70cc55ad1d99b011fa92b42361c39ecceb2e3;p=friendica.git diff --git a/src/DI.php b/src/DI.php index b758ddab0b..0c134f37b4 100644 --- a/src/DI.php +++ b/src/DI.php @@ -99,11 +99,11 @@ abstract class DI } /** - * @return App\Module + * @return App\ModuleController */ public static function module() { - return self::$dice->create(App\Module::class); + return self::$dice->create(App\ModuleController::class); } /** @@ -230,6 +230,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 */ @@ -418,6 +430,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 //