]> git.mxchange.org Git - friendica.git/blobdiff - src/DI.php
add license
[friendica.git] / src / DI.php
index 6fd0e3a7ada89ebd40bdfbf222e4c7887670458b..e5601f64d21aea2abb33b71eb8a14d907b1039c4 100644 (file)
@@ -37,9 +37,24 @@ abstract class DI
        /** @var Dice */
        private static $dice;
 
-       public static function init(Dice $dice)
+       public static function init(Dice $dice, bool $disableDepByHand = false)
        {
                self::$dice = $dice;
+
+               if (!$disableDepByHand) {
+                       self::setCompositeRootDependencyByHand();
+               }
+       }
+
+       /**
+        * I HATE this method, but everything else needs refactoring at the database itself
+        *
+        * @return void
+        */
+       public static function setCompositeRootDependencyByHand()
+       {
+               $database = static::dba();
+               $database->setDependency(static::config(), static::profiler(), static::logger());
        }
 
        /**