]> git.mxchange.org Git - friendica.git/blobdiff - src/BaseObject.php
Adding unittest for empty setApp()
[friendica.git] / src / BaseObject.php
index 4deba1ced15eba7df9c3c53f63318970502fa079..4a6fa12d24b03ad18f4542114f1302d8a9e3573e 100644 (file)
@@ -6,9 +6,7 @@ namespace Friendica;
 
 require_once 'boot.php';
 
-use Friendica\Core\Config;
-use Friendica\Factory;
-use Friendica\Util\BasePath;
+use Friendica\Network\HTTPException\InternalServerErrorException;
 
 /**
  * Basic object
@@ -30,11 +28,7 @@ class BaseObject
        public static function getApp()
        {
                if (empty(self::$app)) {
-                       $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);
+                       throw new InternalServerErrorException('App isn\'t initialized.');
                }
 
                return self::$app;