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