common.inc 890B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. use Symfony\Component\HttpFoundation\Response;
  3. $parent = __DIR__;
  4. while (!@file_exists($parent.'/vendor/autoload.php')) {
  5. if (!@file_exists($parent)) {
  6. // open_basedir restriction in effect
  7. break;
  8. }
  9. if ($parent === dirname($parent)) {
  10. echo "vendor/autoload.php not found\n";
  11. exit(1);
  12. }
  13. $parent = dirname($parent);
  14. }
  15. require $parent.'/vendor/autoload.php';
  16. error_reporting(-1);
  17. ini_set('html_errors', 0);
  18. ini_set('display_errors', 1);
  19. if (ini_get('xdebug.default_enable')) {
  20. xdebug_disable();
  21. }
  22. header_remove('X-Powered-By');
  23. header('Content-Type: text/plain; charset=utf-8');
  24. register_shutdown_function(function () {
  25. echo "\n";
  26. session_write_close();
  27. print_r(headers_list());
  28. echo "shutdown\n";
  29. });
  30. ob_start();
  31. $r = new Response();
  32. $r->headers->set('Date', 'Sat, 12 Nov 1955 20:04:00 GMT');
  33. return $r;