Skip to content

Commit

Permalink
[ENH] introduce http request module
Browse files Browse the repository at this point in the history
bim-g committed Apr 25, 2024
1 parent 047caa0 commit 5eb1628
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/Core/Http/Request.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
/*
* Copyright (c) 2024. Wepesi Dev Framework
*/

namespace Wepesi\Core\Http;

class Request
{
public string $uri;
public string $method;
public array $get;
public array $post;
public array $files;
public array $cookie;
public array $server;

public function __construct(string $uri,
string $method,
array $get,
array $post,
array $files,
array $cookie,
array $server)
{
$this->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);
}
}

0 comments on commit 5eb1628

Please sign in to comment.