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