BioTorrents.de’s version of Gazelle
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.

manifest.php 930B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. declare(strict_types=1);
  3. require_once 'classes/config.php';
  4. # For non-AJAX calls
  5. if ($_SERVER['PHP_SELF'] === '/manifest.php') {
  6. manifest();
  7. }
  8. function manifest()
  9. {
  10. $ENV = ENV::go();
  11. $manifest = <<<JSON
  12. {
  13. "name": "$ENV->SITE_NAME",
  14. "short_name": "$ENV->SITE_NAME",
  15. "description": "$ENV->DESCRIPTION",
  16. "start_url": "index.php",
  17. "display": "standalone",
  18. "background_color": "#ffffff",
  19. "theme_color": "#0288d1",
  20. "icons": [{
  21. "src": "$ENV->STATIC_SERVER/common/icon.png",
  22. "sizes": "120x120",
  23. "type": "image/png"
  24. }]
  25. }
  26. JSON;
  27. # Print header and $manifest for remote addresses
  28. # Return JSON for localhost (API manifest endpoint):
  29. # api.php?action=manifest
  30. if ($_SERVER['REMOTE_ADDR'] !== "127.0.0.1") {
  31. header('Content-type: application/json; charset=utf-8');
  32. echo $manifest;
  33. return;
  34. } else {
  35. return json_decode($manifest);
  36. }
  37. }