friendica_2021-01/src/BaseObject.php

46 lines
575 B
PHP
Raw Normal View History

<?php
/**
* @file src/BaseObject.php
*/
namespace Friendica;
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
*
* @return App
*/
public static function getApp()
{
2018-06-26 02:44:35 +02:00
if (empty(self::$app)) {
self::$app = new App(dirname(__DIR__));
}
return self::$app;
}
/**
* Set the app
*
* @param object $app App
*
* @return void
*/
2018-06-26 02:44:35 +02:00
public static function setApp(App $app)
{
self::$app = $app;
}
}