mirror of
https://github.com/p08dev/Bloggr.git
synced 2026-06-17 12:43:56 +02:00
Initial commit
Base site creation
This commit is contained in:
25
lib/autoload.php
Normal file
25
lib/autoload.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
spl_autoload_register(function ($class_name) {
|
||||
include $class_name . '.php';
|
||||
});
|
||||
|
||||
$request_uri = substr($_SERVER['REQUEST_URI'], 0, 6);
|
||||
|
||||
if(!@include(__DIR__."/config.php")) {
|
||||
if(!($request_uri == "/setup")) {
|
||||
header('Location: /setup.php');
|
||||
die("Redirecting...");
|
||||
}
|
||||
}
|
||||
|
||||
if(@include(__DIR__."/config.php")) {
|
||||
if($request_uri == "/setup") {
|
||||
header('Location: /');
|
||||
die("Redirecting...");
|
||||
}
|
||||
}
|
||||
|
||||
if(!($request_uri == "/setup")) {
|
||||
$pdo = new \PDO('mysql:dbname='.DB_NAME.';host='.DB_HOST.';charset=utf8mb4', DB_USER, DB_PASS);
|
||||
$auth = new \Bloggr\Auth($pdo);
|
||||
}
|
||||
Reference in New Issue
Block a user