Connect to database

This commit is contained in:
grandeljay 2021-11-14 09:13:01 +01:00
parent 44c1d26d89
commit 511de407b0

View file

@ -15,13 +15,32 @@ autoInclude(__DIR__ . '/includes/classes');
autoInclude(__DIR__ . '/includes/functions'); autoInclude(__DIR__ . '/includes/functions');
/** /**
* Install * Config / Install
*/ */
$configPath = 'includes/config/config.php'; $configPath = 'includes/config/config.php';
if (!file_exists($configPath)) { if (file_exists($configPath)) {
} require $configPath;
} else {
$page = 'install'; $page = 'install';
}
/**
* Database
*/
if (
defined('DATABASE_HOST')
&& defined('DATABASE_NAME')
&& defined('DATABASE_USER')
&& defined('DATABASE_PASSWORD')
) {
$database = new wishthis\Database(
DATABASE_HOST,
DATABASE_NAME,
DATABASE_USER,
DATABASE_PASSWORD
);
}
/** /**
* Page * Page