mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 04:45:16 +02:00
Introduce DICE
- Adding dice library - Adding dependency config - Removing Factories - Refactoring App\Mode constructor - Refactoring App\Router constructor - Refactoring BasePath for DI usage - Refactoring ConfigFileLoader constructor - Refactoring Profiler constructor - Adjust entrypoints (index, console, worker, ..) - Adding functional test for DI - Fix tests because of refactorings
This commit is contained in:
parent
5887b9c499
commit
55999730e0
28 changed files with 563 additions and 308 deletions
|
@ -17,6 +17,7 @@ use Friendica\Util\Profiler;
|
|||
use PHPUnit\DbUnit\DataSet\YamlDataSet;
|
||||
use PHPUnit\DbUnit\TestCaseTrait;
|
||||
use PHPUnit_Extensions_Database_DB_IDatabaseConnection;
|
||||
use Psr\Log\NullLogger;
|
||||
|
||||
require_once __DIR__ . '/../boot.php';
|
||||
|
||||
|
@ -46,12 +47,13 @@ abstract class DatabaseTest extends MockedTest
|
|||
{
|
||||
parent::setUpBeforeClass();
|
||||
|
||||
self::$basePath = BasePath::create(dirname(__DIR__));
|
||||
self::$mode = new Mode(self::$basePath);
|
||||
$configLoader = new ConfigFileLoader(self::$basePath, self::$mode);
|
||||
self::$configCache = ConfigFactory::createCache($configLoader);
|
||||
self::$profiler = ProfilerFactory::create(self::$configCache);
|
||||
self::$dba = DBFactory::init(self::$configCache, self::$profiler, $_SERVER);
|
||||
self::$basePath = new BasePath(dirname(__DIR__));
|
||||
$configLoader = new ConfigFileLoader(self::$basePath->getPath());
|
||||
$configFactory = new ConfigFactory();
|
||||
self::$configCache = $configFactory->createCache($configLoader);
|
||||
self::$profiler = new Profiler(self::$configCache);
|
||||
self::$dba = new Database(self::$configCache, self::$profiler, new NullLogger(), $_SERVER);
|
||||
self::$mode = new Mode(self::$basePath, self::$dba, self::$configCache);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue