sponsors.php 1.1 KB

12345678910111213141516171819202122232425
  1. <?php
  2. $app->get('/sponsors/opencollective', function ($request, $response, $args) {
  3. $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
  4. $Organizr->getOpenCollectiveBackers();
  5. $response->getBody()->write(jsonE($GLOBALS['api']));
  6. return $response
  7. ->withHeader('Content-Type', 'application/json;charset=UTF-8')
  8. ->withStatus($GLOBALS['responseCode']);
  9. });
  10. $app->get('/sponsors/github', function ($request, $response, $args) {
  11. $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
  12. $Organizr->getGithubSponsors();
  13. $response->getBody()->write(jsonE($GLOBALS['api']));
  14. return $response
  15. ->withHeader('Content-Type', 'application/json;charset=UTF-8')
  16. ->withStatus($GLOBALS['responseCode']);
  17. });
  18. $app->get('/sponsors/all', function ($request, $response, $args) {
  19. $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
  20. $Organizr->getAllSponsors();
  21. $response->getBody()->write(jsonE($GLOBALS['api']));
  22. return $response
  23. ->withHeader('Content-Type', 'application/json;charset=UTF-8')
  24. ->withStatus($GLOBALS['responseCode']);
  25. });