## Apache Zeta Components Manual :: File Source for request_raw_http.php

## Source for file request_raw_http.php

Documentation is available at request_raw_http.php

1. <?php
2. /**
3. * File containing the ezcMvcHttpRawRequest class
4. *
5. * Licensed to the Apache Software Foundation (ASF) under one
6. * or more contributor license agreements. See the NOTICE file
7. * distributed with this work for additional information
8. * regarding copyright ownership. The ASF licenses this file
9. * to you under the Apache License, Version 2.0 (the
10. * "License"); you may not use this file except in compliance
11. * with the License. You may obtain a copy of the License at
12. *
13. * http://www.apache.org/licenses/LICENSE-2.0
14. *
15. * Unless required by applicable law or agreed to in writing,
16. * software distributed under the License is distributed on an
17. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18. * KIND, either express or implied. See the License for the
19. * specific language governing permissions and limitations
20. * under the License.
21. *
22. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
23. * @version //autogentag//
24. * @filesource
25. * @package MvcTools
26. */
28. /**
29. * Class that encapsulates a semi-parsed HTTP request by using PHP's super
30. * globals to extract information.
31. *
32. * @package MvcTools
33. * @version //autogentag//
34. */
35. class ezcMvcHttpRawRequest extends ezcBaseStruct
36. {
37. /**
38. * Contains an array of headers, where the key is the original HTTP
39. * header name, and the value extracted from the $_SERVER superglobal.
40. *
41. * @var array(string
42. */
43. public $headers ;
45. /**
46. * Contains the request body (read from php://stdin if available).
47. *
48. * @var string
49. */
50. public $body ;
52. /**
53. * Constructs a new ezcMvcHttpRawRequest.
54. *
55. * @param array(string $headers
56. * @param string $body
57. */
58. public function __construct ( $headers = null, $body = '' )
59. {
60. $this-> headers = $headers;
61. $this-> body = $body;
62. }
64. /**
65. * Returns a new instance of this class with the data specified by $array.
66. *
67. * $array contains all the data members of this class in the form:
68. * array('member_name'=>value).
69. *
70. * __set_state makes this class exportable with var_export.
71. * var_export() generates code, that calls this method when it
72. * is parsed with PHP.
73. *
74. * @param array(string=>mixed) $array
75. * @return ezcMvcHttpRawRequest
76. */
77. static public function __set_state ( array $array )
78. {
79. return new ezcMvcHttpRawRequest( $array['headers'], $array['body'] );
80. }
81. }
82. ?>

Documentation generated by phpDocumentor 1.4.3