EXTMVC:
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Web / TX_EXTMVC_Web_Request.php
1 <?php
2
3 /* *
4 * This script belongs to the FLOW3 framework. *
5 * *
6 * It is free software; you can redistribute it and/or modify it under *
7 * the terms of the GNU Lesser General Public License as published by the *
8 * Free Software Foundation, either version 3 of the License, or (at your *
9 * option) any later version. *
10 * *
11 * This script is distributed in the hope that it will be useful, but *
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
13 * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser *
14 * General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with the script. *
18 * If not, see http://www.gnu.org/licenses/lgpl.html *
19 * *
20 * The TYPO3 project - inspiring people to share! *
21 * */
22
23 /**
24 * Represents a web request.
25 *
26 * @version $Id:$
27 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
28 *
29 * @scope prototype
30 */
31 class TX_EXTMVC_Web_Request extends TX_EXTMVC_Request {
32
33 /**
34 * @var string The requested representation format
35 */
36 protected $format = 'html';
37
38 /**
39 * @var string Contains the request method
40 */
41 protected $method = 'GET';
42
43 /**
44 * @var string
45 */
46 protected $requestURI;
47
48 /**
49 * @var string The base URI for this request - ie. the host and path leading to the index.php
50 */
51 protected $baseURI;
52
53 /**
54 * Sets the request method
55 *
56 * @param string $method Name of the request method
57 * @return void
58 * @throws TX_EXTMVC_Exception_InvalidRequestMethod if the request method is not supported
59 */
60 public function setMethod($method) {
61 if ($method === '' || (strtoupper($method) !== $method)) throw new TX_EXTMVC_Exception_InvalidRequestMethod('The request method "' . $method . '" is not supported.', 1217778382);
62 $this->method = $method;
63 }
64
65 /**
66 * Returns the name of the request method
67 *
68 * @return string Name of the request method
69 */
70 public function getMethod() {
71 return $this->method;
72 }
73
74 /**
75 * Sets the request URI
76 *
77 * @param string $requestURI URI of this web request
78 * @return void
79 */
80 public function setRequestURI($requestURI) {
81 $this->requestURI = $requestURI;
82 }
83
84 /**
85 * Returns the request URI
86 *
87 * @return F3_FLOW3_Property_DataType_URI URI of this web request
88 */
89 public function getRequestURI() {
90 return $this->requestURI;
91 }
92
93 /**
94 * Sets the base URI for this request.
95 *
96 * @param string $baseURI New base URI
97 * @return void
98 */
99 public function setBaseURI($baseURI) {
100 $this->baseURI = $baseURI;
101 }
102
103 /**
104 * Returns the base URI
105 *
106 * @return F3_FLOW3_Property_DataType_URI Base URI of this web request
107 */
108 public function getBaseURI() {
109 return $this->baseURI;
110 }
111 }
112 ?>