]> git.mxchange.org Git - friendica.git/blobdiff - src/DI.php
Added contact
[friendica.git] / src / DI.php
index b758ddab0bb84bd301111f95c26230c935da1edc..ead125cff26138f1ef46458ba319f9c72808a38a 100644 (file)
@@ -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
        //