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
{
*/
public static function setUp($channel, $directory, $isBackend = true)
{
- $basedir = BasePath::create($directory, $_SERVER);
- $configLoader = new Cache\ConfigCacheLoader($basedir);
+ $basePath = BasePath::create($directory, $_SERVER);
+ $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($configCache, $profiler, $_SERVER);
$config = Factory\ConfigFactory::createConfig($configCache);
// needed to call PConfig::init()
Factory\ConfigFactory::createPConfig($configCache);
- $logger = Factory\LoggerFactory::create($channel, $config);
+ $logger = Factory\LoggerFactory::create($channel, $config, $profiler);
+ DBA::setLogger($logger);
+ Factory\LoggerFactory::createDev($channel, $config, $profiler);
+ $baseURL = new BaseURL($config, $_SERVER);
- return new App($config, $logger, $profiler, $isBackend);
+ return new App($config, $mode, $router, $baseURL, $logger, $profiler, $isBackend);
}
}