]> git.mxchange.org Git - friendica.git/blob - src/BaseObject.php
Update "storage" console command
[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 use Friendica\Util\LoggerFactory;
10
11 /**
12  * Basic object
13  *
14  * Contains what is useful to any object
15  */
16 class BaseObject
17 {
18         private static $app = null;
19
20         /**
21          * Get the app
22          *
23          * Same as get_app from boot.php
24          *
25          * @return App
26          */
27         public static function getApp()
28         {
29                 if (empty(self::$app)) {
30                         $logger = $logger = LoggerFactory::create('app');
31                         self::$app = new App(dirname(__DIR__), $logger);
32                 }
33
34                 return self::$app;
35         }
36
37         /**
38          * Set the app
39          *
40          * @param App $app App
41          *
42          * @return void
43          */
44         public static function setApp(App $app)
45         {
46                 self::$app = $app;
47         }
48 }