-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathconfig.php
executable file
·30 lines (26 loc) · 995 Bytes
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
if (!file_exists(__DIR__ . '/configs/db.php')) {
header("Location: installer/install.php");
exit;
}
require 'configs/constants.php';
require 'configs/db.php';
require 'helpers/devFunctions.php';
require 'helpers/videoFunctions.php';
require 'helpers/functions.php';
spl_autoload_register(function ($class) {
$class = ucfirst($class);
if (file_exists(MODEL_DIRECTORY . '/' . $class . '.php')) {
require_once MODEL_DIRECTORY . '/' . $class . '.php';
} else {
$class = strtolower($class);
if (file_exists(HELPERS_DIRECTORY . '/' . $class . '.php')) {
require_once HELPERS_DIRECTORY . '/' . $class . '.php';
} else {
exit(MODEL_DIRECTORY . '/' . $class . '.php');
exit('Error Loading Class File |' . $class . '| core:' . CORE_DIRECTORY);
}
}
});
session_start();
$database = new Database($DATABASE_CONFIGS['host'], $DATABASE_CONFIGS['username'], $DATABASE_CONFIGS['password'], $DATABASE_CONFIGS['database']);