]> git.mxchange.org Git - friendica.git/blobdiff - src/BaseObject.php
Move Authentication::setAuthenticatedSessionForUser to Session::setAuthenticatedForUser
[friendica.git] / src / BaseObject.php
index 39f98a38fde061d34b6ba08c75b74569745cea53..9a2d064750b7d74ca13bc17fd2473323cf3298f8 100644 (file)
@@ -4,9 +4,9 @@
  */
 namespace Friendica;
 
-require_once 'boot.php';
+require_once __DIR__ . '/../boot.php';
 
-use Friendica\Util\LoggerFactory;
+use Friendica\Network\HTTPException\InternalServerErrorException;
 
 /**
  * Basic object
@@ -15,6 +15,9 @@ use Friendica\Util\LoggerFactory;
  */
 class BaseObject
 {
+       /**
+        * @var App
+        */
        private static $app = null;
 
        /**
@@ -23,12 +26,12 @@ class BaseObject
         * Same as get_app from boot.php
         *
         * @return App
+        * @throws \Exception
         */
        public static function getApp()
        {
                if (empty(self::$app)) {
-                       $logger = $logger = LoggerFactory::create('app');
-                       self::$app = new App(dirname(__DIR__), $logger);
+                       throw new InternalServerErrorException('App isn\'t initialized.');
                }
 
                return self::$app;