123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- class Request
- {
- public static function get($key, $default = null)
- {
- return isset($_REQUEST[$key]) ? $_REQUEST[$key] : $default;
- }
- public static function has($key) {
- return isset($_REQUEST[$key]);
- }
-
- public static function is_get()
- {
- $method = self::server()->request_method();
- $method = strtoupper($method);
- return $method == 'GET';
- }
- public static function post($key, $default = null)
- {
- return isset($_POST[$key]) ? $_POST[$key] : $default;
- }
-
- public static function is_post()
- {
- $method = self::server()->request_method();
- $method = strtoupper($method);
- return $method == 'POST';
- }
- static function file($key, $default = null)
- {
- return isset($_FILES[$key]) ? $_FILES[$key] : $default;
- }
- static function environment($key, $default = null)
- {
- return isset($_ENV[$key]) ? $_ENV[$key] : $default;
- }
- }
|