]> git.mxchange.org Git - friendica.git/blob - src/BaseObject.php
Add support for legacy $lang config in App->loadConfig
[friendica.git] / src / BaseObject.php
1 <?php
2 /**
3  * @file src/BaseObject.php
4  */
5 namespace Friendica;
6
7 require_once 'boot.php';
8
9 /**
10  * Basic object
11  *
12  * Contains what is useful to any object
13  */
14 class BaseObject
15 {
16         private static $app = null;
17
18         /**
19          * Get the app
20          *
21          * Same as get_app from boot.php
22          *
23          * @return App
24          */
25         public static function getApp()
26         {
27                 if (empty(self::$app)) {
28                         self::$app = new App(dirname(__DIR__));
29                 }
30
31                 return self::$app;
32         }
33
34         /**
35          * Set the app
36          *
37          * @param object $app App
38          *
39          * @return void
40          */
41         public static function setApp(App $app)
42         {
43                 self::$app = $app;
44         }
45 }