X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FBaseObject.php;h=9a2d064750b7d74ca13bc17fd2473323cf3298f8;hb=bf82736522ce570b154ec342b9dee49fa9d3a932;hp=33ed67754674b34731bef4eab345df47be755468;hpb=7efde8e334d6ca52fd1608fb9a78babcea4bdc9f;p=friendica.git diff --git a/src/BaseObject.php b/src/BaseObject.php index 33ed677546..9a2d064750 100644 --- a/src/BaseObject.php +++ b/src/BaseObject.php @@ -4,6 +4,10 @@ */ namespace Friendica; +require_once __DIR__ . '/../boot.php'; + +use Friendica\Network\HTTPException\InternalServerErrorException; + /** * Basic object * @@ -11,6 +15,9 @@ namespace Friendica; */ class BaseObject { + /** + * @var App + */ private static $app = null; /** @@ -19,11 +26,12 @@ class BaseObject * Same as get_app from boot.php * * @return App + * @throws \Exception */ public static function getApp() { if (empty(self::$app)) { - self::$app = new App(dirname(__DIR__)); + throw new InternalServerErrorException('App isn\'t initialized.'); } return self::$app;