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.

64 lines
2.1 KiB

12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
  1. <?php
  2. /**
  3. * The following file shows how to bootstrap phpdbg so that you can mock specific server environments
  4. *
  5. * eval include("web-bootstrap.php")
  6. * exec index.php
  7. * compile
  8. * break ...
  9. * run
  10. */
  11. if (!defined('PHPDBG_BOOTSTRAPPED'))
  12. {
  13. /* define these once */
  14. define("PHPDBG_BOOTPATH", "/opt/php-zts/htdocs");
  15. define("PHPDBG_BOOTSTRAP", "index.php");
  16. define("PHPDBG_BOOTSTRAPPED", sprintf("/%s", PHPDBG_BOOTSTRAP));
  17. }
  18. /*
  19. * Superglobals are JIT, phpdbg will not over-write whatever you set during bootstrap
  20. */
  21. $_SERVER = array
  22. (
  23. 'HTTP_HOST' => 'localhost',
  24. 'HTTP_CONNECTION' => 'keep-alive',
  25. 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  26. 'HTTP_USER_AGENT' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.65 Safari/537.36',
  27. 'HTTP_ACCEPT_ENCODING' => 'gzip,deflate,sdch',
  28. 'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.8',
  29. 'HTTP_COOKIE' => 'tz=Europe%2FLondon; __utma=1.347100075.1384196523.1384196523.1384196523.1; __utmc=1; __utmz=1.1384196523.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)',
  30. 'PATH' => '/usr/local/bin:/usr/bin:/bin',
  31. 'SERVER_SIGNATURE' => '<address>Apache/2.4.6 (Ubuntu) Server at phpdbg.com Port 80</address>',
  32. 'SERVER_SOFTWARE' => 'Apache/2.4.6 (Ubuntu)',
  33. 'SERVER_NAME' => 'localhost',
  34. 'SERVER_ADDR' => '127.0.0.1',
  35. 'SERVER_PORT' => '80',
  36. 'REMOTE_ADDR' => '127.0.0.1',
  37. 'DOCUMENT_ROOT' => PHPDBG_BOOTPATH,
  38. 'REQUEST_SCHEME' => 'http',
  39. 'CONTEXT_PREFIX' => '',
  40. 'CONTEXT_DOCUMENT_ROOT' => PHPDBG_BOOTPATH,
  41. 'SERVER_ADMIN' => '[no address given]',
  42. 'SCRIPT_FILENAME' => sprintf(
  43. '%s/%s', PHPDBG_BOOTPATH, PHPDBG_BOOTSTRAP
  44. ),
  45. 'REMOTE_PORT' => '47931',
  46. 'GATEWAY_INTERFACE' => 'CGI/1.1',
  47. 'SERVER_PROTOCOL' => 'HTTP/1.1',
  48. 'REQUEST_METHOD' => 'GET',
  49. 'QUERY_STRING' => '',
  50. 'REQUEST_URI' => PHPDBG_BOOTSTRAPPED,
  51. 'SCRIPT_NAME' => PHPDBG_BOOTSTRAPPED,
  52. 'PHP_SELF' => PHPDBG_BOOTSTRAPPED,
  53. 'REQUEST_TIME' => time(),
  54. );
  55. $_GET = array();
  56. $_REQUEST = array();
  57. $_POST = array();
  58. $_COOKIE = array();
  59. $_FILES = array();
  60. chdir(PHPDBG_BOOTPATH);