-// Default is not a frameset
-global $isFrameset;
-$isFrameset = false;
-
-// Load library
-require_once(PATH."inc/db/lib.php");
-
-// Load general functions
-require_once(PATH."inc/functions.php"); // Non-database functions
-
-// Load more include files
-require_once(PATH."inc/mysql-manager.php"); // Functions which interact with the database
-
-// Load extensions and language
-require_once(PATH."inc/extensions.php");
-
-// Error handler function
-function __errorHandler ($errno, $errstr, $errfile, $errline) {
- // Construct message
- $msg = sprintf("errno=%s,errstr=%s,errfile=%s,errline=%s",
- $errno,
- $errstr,
- basename($errfile),
- $errline
- );
-
- // Write debug log message
- DEBUG_LOG(__FUNCTION__, __LINE__, "".$msg, true);
-
- // Output message to user and die
- if (EXT_IS_ACTIVE("debug")) {
- // Debug extension found! :-)
- die("Error message written to debug.log. Please try to call <a href=\"".URL."\">the main page</a> to continue.");
- } else {
- // No debug extension found
- print("Please report this error at <a href=\"http://forum.mxchange.org\" target=\"_blank\">forum.mxchange.org</a>:<pre>");
- debug_print_backtrace();
- die("</pre>Thank you for your help finding bugs.");
- }
-}
+// Non-database functions
+require("inc/functions.php");
+
+// Load more function libraries or includes
+foreach (array('request-functions', 'session-functions', 'config-functions', 'filters', 'mysql-manager', 'extensions', 'db/lib', 'handler', 'hooks', 'session') as $lib) {
+ // Load special functions
+ LOAD_INC_ONCE(sprintf("inc/%s.php", $lib));
+} // END - foreach