2017-11-16 18:05:41 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @file src/Core/BaseObject.php
|
|
|
|
*/
|
|
|
|
namespace Friendica\Core;
|
|
|
|
|
|
|
|
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
|
|
|
*
|
|
|
|
* @return object
|
2017-11-16 18:05:41 +00:00
|
|
|
*/
|
2017-11-19 19:15:25 +00:00
|
|
|
public function getApp()
|
2017-11-16 18:05:41 +00:00
|
|
|
{
|
|
|
|
if (self::$app) {
|
|
|
|
return self::$app;
|
|
|
|
}
|
|
|
|
|
|
|
|
self::$app = boot::get_app();
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|