refactor
- move elixForms API logic to specific folder - move everything else under Api folder
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace Core;
|
||||
|
||||
class Request {
|
||||
public function method() {
|
||||
return $_SERVER['REQUEST_METHOD'];
|
||||
}
|
||||
|
||||
public function path() {
|
||||
return strtok($_SERVER['REQUEST_URI'], '?');
|
||||
}
|
||||
|
||||
public function body() {
|
||||
return json_decode(file_get_contents('php://input'), true);
|
||||
}
|
||||
|
||||
public function query() {
|
||||
return $_GET;
|
||||
}
|
||||
|
||||
public function header(string $name): ?string
|
||||
{
|
||||
$key = 'HTTP_' . strtoupper(str_replace('-', '_', $name));
|
||||
return $_SERVER[$key] ?? null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user