1
0
Fork 0

3) Introducing ConfigFactory

This commit is contained in:
Philipp Holzer 2019-02-03 22:22:04 +01:00
commit 4af0119b73
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
23 changed files with 843 additions and 632 deletions

View file

@ -5,7 +5,9 @@
*/
use Friendica\App;
use Friendica\Util\LoggerFactory;
use Friendica\Core\Config;
use Friendica\Factory;
use Friendica\Util\BasePath;
if (!file_exists(__DIR__ . '/vendor/autoload.php')) {
die('Vendor path not found. Please execute "bin/composer.phar --no-dev install" on the command line in the web root.');
@ -13,10 +15,13 @@ if (!file_exists(__DIR__ . '/vendor/autoload.php')) {
require __DIR__ . '/vendor/autoload.php';
$logger = LoggerFactory::create('index');
$basedir = BasePath::create(__DIR__);
$configLoader = new Config\ConfigCacheLoader($basedir);
$config = Factory\ConfigFactory::createCache($configLoader);
$logger = Factory\LoggerFactory::create('index', $config);
// We assume that the index.php is called by a frontend process
// The value is set to "true" by default in App
$a = new App(__DIR__, $logger, false);
$a = new App($config, $logger, false);
$a->runFrontend();