| 1 | <?php |
||
| 12 | abstract class Request { |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Check whether this is an ajax request |
||
| 16 | */ |
||
| 17 | |||
| 18 | public static function isAjax() : bool { |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Check whether this is a special ajax request |
||
| 25 | */ |
||
| 26 | |||
| 27 | public static function isSpecial(string $type) : bool { |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Check whether this is a HTTPS request |
||
| 34 | */ |
||
| 35 | |||
| 36 | public static function isSecure() : bool { |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Get a GET-param value |
||
| 45 | * |
||
| 46 | * @return string|false : the value or false if the param does not exist |
||
| 47 | */ |
||
| 48 | |||
| 49 | public static function get(string $name) { |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Get a POST-param value |
||
| 56 | * |
||
| 57 | * @return string|false : the value or false if the param does not exist |
||
| 58 | */ |
||
| 59 | |||
| 60 | public static function post(string $name) { |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Get a FILE-param value |
||
| 67 | * |
||
| 68 | * @return array|false : the array with file info or false if the param does not exist |
||
| 69 | */ |
||
| 70 | |||
| 71 | public static function file(string $name) { |
||
| 75 | |||
| 76 | /** |
||
| 77 | * Redirect to a specified url and terminate the script |
||
| 78 | */ |
||
| 79 | |||
| 80 | public static function redirect(string $url) { |
||
| 84 | } |
||
| 85 | } |
||
| 86 |