mirror of
https://github.com/fruithost/Panel.git
synced 2026-12-01 04:45:04 +09:00
Adding request class for testing
This commit is contained in:
1 parent
18b3a03dcf
commit
fd6b71b459
2 files changed
+20
No files matched your search
@@ -70,6 +70,8 @@
|
||||
}
|
||||
|
||||
private function init() {
|
||||
Request::init();
|
||||
|
||||
$this->hooks = new Hooks();
|
||||
$this->modules = new Modules($this);
|
||||
$this->template = new Template($this);
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
namespace fruithost;
|
||||
|
||||
class Request {
|
||||
private static $get = [];
|
||||
|
||||
public static function init() {
|
||||
self::$get = $_GET;
|
||||
}
|
||||
|
||||
public static function has($name) {
|
||||
return in_array($name, self::$get);
|
||||
}
|
||||
|
||||
public static function get($name) {
|
||||
if(self::has($name)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return self::$get[$name];
|
||||
}
|
||||
|
||||
public static function url() {
|
||||
return $_SERVER['REQUEST_URI'];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user