WebAppManifestResource.php 785 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace Elgg\Http;
  3. use ElggSite;
  4. /**
  5. * Overview: http://html5doctor.com/web-manifest-specification/
  6. * Spec: https://w3c.github.io/manifest/
  7. *
  8. * Support was added to Chrome 39 and is expected to come to Firefox soon.
  9. *
  10. * @package Elgg.Core
  11. * @subpackage Http
  12. * @since 1.10
  13. *
  14. * @access private
  15. */
  16. class WebAppManifestResource {
  17. /** @var ElggSite */
  18. private $site;
  19. /**
  20. * Constructor
  21. *
  22. * @param ElggSite $site The site serving this manifest.
  23. */
  24. public function __construct(ElggSite $site) {
  25. $this->site = $site;
  26. }
  27. /**
  28. * Behavior for HTTP GET method
  29. *
  30. * @return array
  31. */
  32. public function get() {
  33. return [
  34. 'display' => 'standalone',
  35. 'name' => $this->site->getDisplayName(),
  36. 'start_url' => $this->site->getUrl(),
  37. ];
  38. }
  39. }