Continued:
[core.git] / framework / main / classes / request / class_
1 <?php
2 // Own namespace
3 namespace CoreFramework\Request;
4
5 /**
6  * A concrete request class
7  *
8  * @author              Roland Haeder <webmaster@ship-simu.org>
9  * @version             0.0.0
10  * @copyright   Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
11  * @license             GNU GPL 3.0 or any newer version
12  * @link                http://www.ship-simu.org
13  *
14  * This program is free software: you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation, either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program. If not, see <http://www.gnu.org/licenses/>.
26  */
27 class ???Request extends BaseRequest implements Requestable {
28         /**
29          * Protected constructor
30          *
31          * @return      void
32          */
33         protected function __construct () {
34                 // Call parent constructor
35                 parent::__construct(__CLASS__);
36         }
37
38         /**
39          * Creates an instance of this class and prepares it a little
40          *
41          * @return      $httpInstance   An instance of this class
42          */
43         public final static function create???Request () {
44                 // Create an instance
45                 $httpInstance = new ???Request();
46
47                 // Prepare the HTTP request data for usage
48                 $httpInstance->prepareRequestData();
49
50                 // Return the prepared instance
51                 return $httpInstance;
52         }
53
54         /**
55          * Prepares the request data for usage
56          *
57          * @return      void
58          * @todo        Needs to be implemented
59          */
60         public function prepareRequestData () {
61                 $this->partialStub("Please implement this method.");
62         }
63
64         /**
65          * Getter for a header element or 'null' if header was not found
66          *
67          * @param       $headerName             Name of the header
68          * @return      $headerValue    Value of the header or 'null' if not found
69          */
70         public function getHeaderElement ($headerName) {
71                 $this->partialStub("Please implement this method.");
72         }
73
74         /**
75          * Getter for request method. This getter might be useful for security filters
76          *
77          * @return      $requestMethod  Used request method
78          */
79         public final function getRequestMethod () {
80                 $this->partialStub("Please implement this method.");
81                 return $_SERVER['REQUEST_METHOD'];
82         }
83
84         /**
85          * Reads a cookie and returns it's value or null if not found
86          *
87          * @param       $cookieName             Name of cookie we shall read
88          * @return      $cookieValue    Value of cookie or null if not found
89          */
90         public final function readCookie ($cookieName) {
91                 $this->partialStub("Please implement this method.");
92         }
93
94 }