]> git.mxchange.org Git - friendica.git/blobdiff - src/BaseObject.php
Move App->checkBackend after module determination
[friendica.git] / src / BaseObject.php
index 6b64daccf0d8dbbd3bc47d75cd7964db0fbc8e28..7e90478a9d613a378bf28dace96144a9b38f94b5 100644 (file)
@@ -4,7 +4,9 @@
  */
 namespace Friendica;
 
-require_once 'boot.php';
+require_once __DIR__ . '/../boot.php';
+
+use Friendica\Network\HTTPException\InternalServerErrorException;
 
 /**
  * Basic object
@@ -21,11 +23,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;
@@ -34,7 +37,7 @@ class BaseObject
        /**
         * Set the app
         *
-        * @param object $app App
+        * @param App $app App
         *
         * @return void
         */