]> git.mxchange.org Git - friendica.git/blobdiff - src/Factory/DependencyFactory.php
Move mod/toggle_mobile to src/Module/ToggleMobile
[friendica.git] / src / Factory / DependencyFactory.php
index 67384452e92f93b028a38f46f12a9671ea2fbab9..aacd1550605c365b46be6a82a8bf2a0ed64d75e3 100644 (file)
@@ -3,9 +3,11 @@
 namespace Friendica\Factory;
 
 use Friendica\App;
-use Friendica\Core\Config\Cache;
+use Friendica\Database\DBA;
 use Friendica\Factory;
 use Friendica\Util\BasePath;
+use Friendica\Util\BaseURL;
+use Friendica\Util\Config;
 
 class DependencyFactory
 {
@@ -23,16 +25,20 @@ class DependencyFactory
        public static function setUp($channel, $directory, $isBackend = true)
        {
                $basePath = BasePath::create($directory, $_SERVER);
-               $configLoader = new Cache\ConfigCacheLoader($basePath);
+               $mode = new App\Mode($basePath);
+               $router = new App\Router();
+               $configLoader = new Config\ConfigFileLoader($basePath, $mode);
                $configCache = Factory\ConfigFactory::createCache($configLoader);
                $profiler = Factory\ProfilerFactory::create($configCache);
-               Factory\DBFactory::init($basePath, $configCache, $profiler, $_SERVER);
+               Factory\DBFactory::init($configCache, $profiler, $_SERVER);
                $config = Factory\ConfigFactory::createConfig($configCache);
                // needed to call PConfig::init()
                Factory\ConfigFactory::createPConfig($configCache);
                $logger = Factory\LoggerFactory::create($channel, $config, $profiler);
-               Factory\LoggerFactory::createDev($channel, $config);
+               DBA::setLogger($logger);
+               Factory\LoggerFactory::createDev($channel, $config, $profiler);
+               $baseURL = new BaseURL($config, $_SERVER);
 
-               return new App($basePath, $config, $logger, $profiler, $isBackend);
+               return new App($config, $mode, $router, $baseURL, $logger, $profiler, $isBackend);
        }
 }