This commit is contained in:
2024-07-19 13:05:21 +02:00
parent 88f535a1ed
commit 156d277e77
10 changed files with 229 additions and 71 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
class Config
{
private static $instances = [];
private static array $instances = [];
private array $app;
private array $database;
+1 -1
View File
@@ -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)
{
+3 -3
View File
@@ -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
View File
@@ -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 : [];
}
}