*/
namespace Friendica;
-require_once 'boot.php';
+require_once __DIR__ . '/../boot.php';
-use Friendica\Core\Config;
-use Friendica\Factory;
-use Friendica\Util\BasePath;
+use Friendica\Network\HTTPException\InternalServerErrorException;
/**
* Basic object
*/
class BaseObject
{
+ /**
+ * @var App
+ */
private static $app = null;
/**
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;