-// CFG: DEBUG-SQL (if enabled and DEBUG_MODE is enabled all SQL queries will be logged to debug.log)
-define('DEBUG_SQL', false);
-
-// 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");
-
-// 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');
+
+// Wrapper functions
+require('inc/wrapper-functions.php');
+
+// Load more function libraries or includes
+foreach (array('request-functions', 'session-functions', 'config-functions', 'code-functions', 'inc-functions', 'language-functions', 'filters', 'mysql-manager', 'extensions', 'db/lib', 'handler', 'hooks') as $lib) {
+ // Load special functions
+ loadIncludeOnce('inc/' . $lib . '.php');
+} // END - foreach