Skip to content

Commit

Permalink
Merge pull request #188 from kivudesign/app_request
Browse files Browse the repository at this point in the history
[ENH] introduce http request module
  • Loading branch information
bim-g authored Sep 2, 2024
2 parents 7ff4565 + 5eb1628 commit 8ca4506
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 8ca4506

Please sign in to comment.