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.

44 lines
546B

  1. <?php
  2. /**
  3. * @file src/BaseObject.php
  4. */
  5. namespace Friendica;
  6. /**
  7. * Basic object
  8. *
  9. * Contains what is useful to any object
  10. */
  11. class BaseObject
  12. {
  13. private static $app = null;
  14. /**
  15. * Get the app
  16. *
  17. * Same as get_app from boot.php
  18. *
  19. * @return App
  20. */
  21. public static function getApp()
  22. {
  23. if (empty(self::$app)) {
  24. self::$app = new App(dirname(__DIR__));
  25. }
  26. return self::$app;
  27. }
  28. /**
  29. * Set the app
  30. *
  31. * @param App $app App
  32. *
  33. * @return void
  34. */
  35. public static function setApp(App $app)
  36. {
  37. self::$app = $app;
  38. }
  39. }