MS-Tropical/app/bootstrap.php

42 lines
1.1 KiB
PHP
Raw 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' => 'classes/Article.php',
2024-06-29 08:06:29 -05:00
'ArticleComment' => 'classes/ArticleComment.php',
'EpisodeComment' => 'classes/EpisodeComment.php',
'Project' => 'classes/Project.php',
'Show' => 'classes/Show.php',
'User' => 'classes/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;
});