Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
572B

  1. <?php
  2. /**
  3. * @file src/BaseObject.php
  4. */
  5. namespace Friendica;
  6. require_once 'boot.php';
  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. * Get the app
  17. *
  18. * Same as get_app from boot.php
  19. *
  20. * @return App
  21. */
  22. public static function getApp()
  23. {
  24. if (empty(self::$app)) {
  25. self::$app = new App(dirname(__DIR__));
  26. }
  27. return self::$app;
  28. }
  29. /**
  30. * Set the app
  31. *
  32. * @param App $app App
  33. *
  34. * @return void
  35. */
  36. public static function setApp(App $app)
  37. {
  38. self::$app = $app;
  39. }
  40. }