2017-11-16 18:05:41 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2017-11-19 21:50:49 +00:00
|
|
|
* @file src/BaseObject.php
|
2017-11-16 18:05:41 +00:00
|
|
|
*/
|
2017-11-19 21:50:49 +00:00
|
|
|
namespace Friendica;
|
2017-11-16 18:05:41 +00:00
|
|
|
|
|
|
|
require_once 'boot.php';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Basic object
|
|
|
|
*
|
|
|
|
* Contains what is useful to any object
|
|
|
|
*/
|
|
|
|
class BaseObject
|
|
|
|
{
|
|
|
|
private static $app = null;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the app
|
|
|
|
*
|
|
|
|
* Same as get_app from boot.php
|
2017-11-19 19:15:25 +00:00
|
|
|
*
|
2017-12-17 16:34:43 +00:00
|
|
|
* @return App
|
2017-11-16 18:05:41 +00:00
|
|
|
*/
|
2017-11-19 21:50:49 +00:00
|
|
|
public static function getApp()
|
2017-11-16 18:05:41 +00:00
|
|
|
{
|
|
|
|
if (self::$app) {
|
|
|
|
return self::$app;
|
|
|
|
}
|
|
|
|
|
2017-11-19 21:50:49 +00:00
|
|
|
self::$app = get_app();
|
2017-11-16 18:05:41 +00:00
|
|
|
|
|
|
|
return self::$app;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the app
|
|
|
|
*
|
|
|
|
* @param object $app App
|
2017-11-19 19:15:25 +00:00
|
|
|
*
|
|
|
|
* @return void
|
2017-11-16 18:05:41 +00:00
|
|
|
*/
|
2017-11-19 19:15:25 +00:00
|
|
|
public static function setApp($app)
|
2017-11-16 18:05:41 +00:00
|
|
|
{
|
|
|
|
self::$app = $app;
|
|
|
|
}
|
|
|
|
}
|