MS-Tropical/app/bootstrap.php

45 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2024-06-29 08:06:29 -05:00
<?php
/*
///
// This is the bootstrap file; grabs all the important things the library
// used to but needed separated.
///
*/
ini_set('display_errors', 'On');
error_reporting(E_ALL | E_STRICT);
session_start();
require_once('../app/library.php');
// ---------------------------------------------------------------------------- //
// ---------------------------------------------------------------------------- //
/// Autoloader to get all our classes.
const MAP = [
'Article' => 'models/Article.php',
'ArticleComment' => 'models/ArticleComment.php',
'EpisodeComment' => 'models/EpisodeComment.php',
'Project' => 'models/Project.php',
'Show' => 'models/Show.php',
'User' => 'models/User.php',
2024-06-29 08:06:29 -05:00
'Database' => 'modules/Database.php',
2024-06-29 08:06:29 -05:00
'CommunityModule' => 'modules/CommunityModule.php',
'DisplayModule' => 'modules/DisplayModule.php',
'ParserModule' => 'modules/ParserModule.php',
2024-06-29 08:06:29 -05:00
'CommunityHub' => 'hubs/CommunityHub.php'
];
spl_autoload_register(function ($class) {
if (!isset(MAP[$class])) return false;
require_once '../app/' . MAP[$class];
return true;
});
// Initialize the database handler
Database::init('../app/database.db');