diff --git a/app/bootstrap.php b/app/bootstrap.php new file mode 100644 index 0000000..c955a74 --- /dev/null +++ b/app/bootstrap.php @@ -0,0 +1,41 @@ + 'classes/Article.php', + 'ArticleComment' => 'classes/ArticleComment.php', + 'EpisodeComment' => 'classes/EpisodeComment.php', + 'Project' => 'classes/Project.php', + 'Show' => 'classes/Show.php', + 'User' => 'classes/User.php', + + 'DatabaseModule' => 'modules/DatabaseModule.php', + 'CommunityModule' => 'modules/CommunityModule.php', + 'DisplayModule' => 'modules/DisplayModule.php', + 'ParserModule' => 'modules/ParserModule.php', + + 'CommunityHub' => 'hubs/CommunityHub.php' +]; + +spl_autoload_register(function ($class) { + if (!isset(MAP[$class])) return false; + require_once '../app/' . MAP[$class]; + return true; +}); diff --git a/app/library.php b/app/library.php index e9544ca..5a9b87b 100755 --- a/app/library.php +++ b/app/library.php @@ -7,24 +7,6 @@ /// */ - ini_set('display_errors', 'On'); - error_reporting(E_ALL | E_STRICT); - - // ---------------------------------------------------------------------------- // - // ---------------------------------------------------------------------------- // - /// Includes, so we can use them elsewhere without having to call them each time. - - include($_SERVER["DOCUMENT_ROOT"] . "/Resources/Scripts/PHP/Classes/User.php"); - include($_SERVER["DOCUMENT_ROOT"] . "/Resources/Scripts/PHP/Classes/Show.php"); - include($_SERVER["DOCUMENT_ROOT"] . "/Resources/Scripts/PHP/Classes/Article.php"); - include($_SERVER["DOCUMENT_ROOT"] . "/Resources/Scripts/PHP/Classes/Project.php"); - include($_SERVER["DOCUMENT_ROOT"] . "/Resources/Scripts/PHP/Classes/ArticleComment.php"); - include($_SERVER["DOCUMENT_ROOT"] . "/Resources/Scripts/PHP/Classes/EpisodeComment.php"); - - include($_SERVER["DOCUMENT_ROOT"] . "/Resources/Scripts/PHP/Modules/DisplayModule.php"); - include($_SERVER["DOCUMENT_ROOT"] . "/Resources/Scripts/PHP/Modules/DatabaseModule.php"); - include($_SERVER["DOCUMENT_ROOT"] . "/Resources/Scripts/PHP/Modules/CommunityModule.php"); - // ---------------------------------------------------------------------------- // // ---------------------------------------------------------------------------- // /// Misc functions - used for who-knows-what and who-knows-when. @@ -83,8 +65,7 @@ // This function serves to prevent tags within HTML getting into things. It's basically a symbol cleaner. // Kudos to Atli from Dream.In.Code for showing me htmlentities()! function magicClean($text) { - $text = htmlentities($text, ENT_QUOTES, "UTF-8"); - return $text; + return htmlentities($text, ENT_QUOTES, "UTF-8"); } // Hash a password thousands of times using a random salt. diff --git a/app/modules/DisplayModule.php b/app/modules/DisplayModule.php index 0513baa..d739abb 100755 --- a/app/modules/DisplayModule.php +++ b/app/modules/DisplayModule.php @@ -1,20 +1,4 @@ - -
- - - - -