Drupal investigation

Request.php 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\BrowserKit;
  11. /**
  12. * Request object.
  13. *
  14. * @author Fabien Potencier <fabien@symfony.com>
  15. */
  16. class Request
  17. {
  18. protected $uri;
  19. protected $method;
  20. protected $parameters;
  21. protected $files;
  22. protected $cookies;
  23. protected $server;
  24. protected $content;
  25. /**
  26. * Constructor.
  27. *
  28. * @param string $uri The request URI
  29. * @param string $method The HTTP method request
  30. * @param array $parameters The request parameters
  31. * @param array $files An array of uploaded files
  32. * @param array $cookies An array of cookies
  33. * @param array $server An array of server parameters
  34. * @param string $content The raw body data
  35. */
  36. public function __construct($uri, $method, array $parameters = array(), array $files = array(), array $cookies = array(), array $server = array(), $content = null)
  37. {
  38. $this->uri = $uri;
  39. $this->method = $method;
  40. $this->parameters = $parameters;
  41. $this->files = $files;
  42. $this->cookies = $cookies;
  43. $this->server = $server;
  44. $this->content = $content;
  45. }
  46. /**
  47. * Gets the request URI.
  48. *
  49. * @return string The request URI
  50. */
  51. public function getUri()
  52. {
  53. return $this->uri;
  54. }
  55. /**
  56. * Gets the request HTTP method.
  57. *
  58. * @return string The request HTTP method
  59. */
  60. public function getMethod()
  61. {
  62. return $this->method;
  63. }
  64. /**
  65. * Gets the request parameters.
  66. *
  67. * @return array The request parameters
  68. */
  69. public function getParameters()
  70. {
  71. return $this->parameters;
  72. }
  73. /**
  74. * Gets the request server files.
  75. *
  76. * @return array The request files
  77. */
  78. public function getFiles()
  79. {
  80. return $this->files;
  81. }
  82. /**
  83. * Gets the request cookies.
  84. *
  85. * @return array The request cookies
  86. */
  87. public function getCookies()
  88. {
  89. return $this->cookies;
  90. }
  91. /**
  92. * Gets the request server parameters.
  93. *
  94. * @return array The request server parameters
  95. */
  96. public function getServer()
  97. {
  98. return $this->server;
  99. }
  100. /**
  101. * Gets the request raw body data.
  102. *
  103. * @return string The request raw body data
  104. */
  105. public function getContent()
  106. {
  107. return $this->content;
  108. }
  109. }