-require_once(PATH."inc/functions.php");
-
-// Filter functions
-require_once(PATH."inc/filters.php");
-
-// Functions which interact with the database
-require_once(PATH."inc/mysql-manager.php");
-
-// 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\" rel=\"external\" target=\"_blank\">forum.mxchange.org</a>:<pre>");
- debug_print_backtrace();
- die("</pre>Thank you for your help finding bugs.");
- }
-}
+require("inc/functions.php");
+
+// Load more function libraries or includes
+foreach (array('request-functions', 'session-functions', 'config-functions', 'code-functions', 'filters', 'mysql-manager', 'extensions', 'db/lib', 'handler', 'hooks') as $lib) {
+ // Load special functions
+ LOAD_INC_ONCE(sprintf("inc/%s.php", $lib));
+} // END - foreach