show_config_errors.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Simple wrapper just to enable error reporting and include config
  4. */
  5. declare(strict_types=1);
  6. if (! defined('ROOT_PATH')) {
  7. // phpcs:disable PSR1.Files.SideEffects
  8. define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
  9. // phpcs:enable
  10. }
  11. // rfc2616 - Section 14.21
  12. header('Expires: ' . gmdate(DATE_RFC1123));
  13. // HTTP/1.1
  14. header(
  15. 'Cache-Control: no-store, no-cache, must-revalidate,'
  16. . ' pre-check=0, post-check=0, max-age=0'
  17. );
  18. if (isset($_SERVER['HTTP_USER_AGENT'])
  19. && stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false
  20. ) {
  21. /* FIXME: Why is this special case for IE needed? */
  22. header('Pragma: public');
  23. } else {
  24. header('Pragma: no-cache'); // HTTP/1.0
  25. // test case: exporting a database into a .gz file with Safari
  26. // would produce files not having the current time
  27. // (added this header for Safari but should not harm other browsers)
  28. header('Last-Modified: ' . gmdate(DATE_RFC1123));
  29. }
  30. header('Content-Type: text/html; charset=utf-8');
  31. // phpcs:disable PSR1.Files.SideEffects
  32. define('PHPMYADMIN', true);
  33. // phpcs:enable
  34. require ROOT_PATH . 'libraries/vendor_config.php';
  35. // issue #16256 - This only works with php 8.0+
  36. if (function_exists('error_reporting')) {
  37. error_reporting(E_ALL);
  38. }
  39. /**
  40. * Read config file.
  41. */
  42. if (is_readable(CONFIG_FILE)) {
  43. include CONFIG_FILE;
  44. }