show_config_errors.php 1.2 KB

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