-// 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");
-require_once(PATH."inc/language.php");
-
-// Init error handler
-function __errorHandler ($errno, $errstr, $errfile, $errline) {
- $msg = sprintf("errno=%s,errstr=%s,errfile=%s,errline=%s",
- $errno,
- $errstr,
- basename($errfile),
- $errline
- );
- DEBUG_LOG(__FUNCTION__.":".$msg, true);
- print "Please report this error at <a href=\"http://forum.mxchange.org\" target=\"_blank\">forum.mxchange.org</a>:<pre>";
- debug_print_backtrace();
- die("</pre>Thanks 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