Fix API
This commit is contained in:
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
class Config
|
||||
{
|
||||
private static $instances = [];
|
||||
private static array $instances = [];
|
||||
|
||||
private array $app;
|
||||
private array $database;
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
class Database extends PDO
|
||||
{
|
||||
private static $instances = [];
|
||||
private static array $instances = [];
|
||||
|
||||
protected function __construct($dsn, $username = null, $password = null, array $options = null)
|
||||
{
|
||||
|
||||
Vendored
+3
-3
@@ -2,18 +2,18 @@
|
||||
|
||||
class Headers
|
||||
{
|
||||
static function json()
|
||||
public static function json()
|
||||
{
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
header("Content-Type: text/json");
|
||||
}
|
||||
|
||||
static function html()
|
||||
public static function html()
|
||||
{
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
}
|
||||
|
||||
static function redirect(string $newUrl, bool $permanent = FALSE)
|
||||
public static function redirect(string $newUrl, bool $permanent = FALSE)
|
||||
{
|
||||
header('Location: ' . $newUrl, true, $permanent ? 301 : 303);
|
||||
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
class PathParams
|
||||
{
|
||||
public static function get()
|
||||
{
|
||||
$path = ltrim(str_replace(Config::getBasePath(), "", $_SERVER['REQUEST_URI']), "/");
|
||||
$segs = explode("/", $path);
|
||||
return $segs ? $segs : [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user