mirror of
https://github.com/friendica/friendica
synced 2025-04-26 16:30:12 +00:00
4) Adding Factories to other entrypoints
This commit is contained in:
parent
4af0119b73
commit
1e0e1674f2
20 changed files with 100 additions and 58 deletions
|
@ -6,7 +6,9 @@ namespace Friendica;
|
|||
|
||||
require_once 'boot.php';
|
||||
|
||||
use Friendica\Util\LoggerFactory;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Factory;
|
||||
use Friendica\Util\BasePath;
|
||||
|
||||
/**
|
||||
* Basic object
|
||||
|
@ -28,8 +30,11 @@ class BaseObject
|
|||
public static function getApp()
|
||||
{
|
||||
if (empty(self::$app)) {
|
||||
$logger = $logger = LoggerFactory::create('app');
|
||||
self::$app = new App(dirname(__DIR__), $logger);
|
||||
$basedir = BasePath::create(dirname(__DIR__));
|
||||
$configLoader = new Config\ConfigCacheLoader($basedir);
|
||||
$config = Factory\ConfigFactory::createCache($configLoader);
|
||||
$logger = Factory\LoggerFactory::create('app', $config);
|
||||
self::$app = new App($config, $logger);
|
||||
}
|
||||
|
||||
return self::$app;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue