From 5eb162844b4d956acb9ed09b0105570f480145a1 Mon Sep 17 00:00:00 2001 From: bim-g Date: Thu, 25 Apr 2024 21:53:17 +0200 Subject: [PATCH] [ENH] introduce http request module --- src/Core/Http/Request.php | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/Core/Http/Request.php diff --git a/src/Core/Http/Request.php b/src/Core/Http/Request.php new file mode 100644 index 0000000..4891d41 --- /dev/null +++ b/src/Core/Http/Request.php @@ -0,0 +1,45 @@ +server = $server; + $this->cookie = $cookie; + $this->files = $files; + $this->post = $post; + $this->get = $get; + $this->method = $method; + $this->uri = $uri; + } + + public static function createFromGlobals(): Request + { + return new static($_SERVER['REQUEST_URI'], + $_SERVER['REQUEST_METHOD'], + $_GET, + $_POST, + $_FILES, + $_COOKIE, + $_SERVER); + } +}