]> git.mxchange.org Git - friendica.git/blobdiff - src/DI.php
Merge pull request #11141 from urbalazs/language-names
[friendica.git] / src / DI.php
index 82364478448d1e3b4e61c3cebb629f44fbea8a5d..708fb7d836da3fe54a7c72bc40d81c4ce1a19a3b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -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
         */
@@ -195,11 +187,11 @@ abstract class DI
        }
 
        /**
-        * @return Core\Process
+        * @return Core\Worker\Repository\Process
         */
        public static function process()
        {
-               return self::$dice->create(Core\Process::class);
+               return self::$dice->create(Core\Worker\Repository\Process::class);
        }
 
        /**
@@ -218,10 +210,30 @@ abstract class DI
                return self::$dice->create(Core\Storage\Repository\StorageManager::class);
        }
 
+       /**
+        * @return \Friendica\Core\System
+        */
+       public static function system()
+       {
+               return self::$dice->create(Core\System::class);
+       }
+
        //
        // "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
         */
@@ -362,6 +374,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
         */
@@ -379,11 +399,11 @@ abstract class DI
        // "Model" namespace instances
        //
        /**
-        * @return Model\Process
+        * @return \Friendica\Core\Worker\Repository\Process
         */
        public static function modelProcess()
        {
-               return self::$dice->create(Model\Process::class);
+               return self::$dice->create(Core\Worker\Repository\Process::class);
        }
 
        /**
@@ -410,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
        //