// Load database library
require_once(PATH."inc/db/lib.php");
-// // Non-database functions
+// Non-database functions
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");
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>");
+ 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.");
}
// Set error handler
set_error_handler('__errorHandler');
+// Call-back function for running shutdown functions
+function __RUN_SHUTDOWN_FILTER () {
+ // Call the filter chain 'shutdown'
+ RUN_FILTER('shutdown', null, false);
+}
+
+// Register shutdown hook
+register_shutdown_function('__RUN_SHUTDOWN_FILTER');
+
// Check if the user setups his MySQL stuff...
if ((empty($MySQL['login'])) && (!defined('mxchange_installing')) && (!isset($_GET['installing'])) && (isBooleanConstantAndTrue('mxchange_installed'))) {
// No login entered and outside installation mode
// Loading patching system is required here...
require_once(PATH."inc/patch-system.php"); // Initialize patch system
- // Functions which are related to themes
- require_once(PATH."inc/theme-manager.php");
+ // Session management
+ require_once(PATH."inc/session.php");
// Run daily reset
require_once(PATH."inc/check-reset.php");
+ // Create missing configuration file
+ if (!function_exists('GET_CURR_THEME')) {
+ // Load dummy theme functions
+ require_once(PATH."inc/theme-dummy.php");
+ } // END - if
+
// Load admin include file if he is admin
if (IS_ADMIN()) {
// Administrative functions
// Include required files
require_once(PATH."inc/databases.php");
- require_once(PATH."inc/theme-manager.php");
+ require_once(PATH."inc/session.php");
+
+ // Create missing configuration file
+ if (!function_exists('GET_CURR_THEME')) {
+ // Load dummy theme functions
+ require_once(PATH."inc/theme-dummy.php");
+ } // END - if
// Check if we are in installation routine
$installPhp = basename($_SERVER['PHP_SELF']);
// Double-check installation mode
if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered'))) {
// Check for file permissions
- if (!is_INCWritable("config")) {
+ if (!IS_INC_WRITEABLE("config")) {
ADD_FATAL(CONFIG_IS_WRITE_PROTECTED);
- }
- if (!is_INCWritable("dummy")) {
+ } // END - if
+ if (!IS_INC_WRITEABLE("dummy")) {
ADD_FATAL(DUMMY_IS_WRITE_PROTECTED);
- }
- if (!is_INCWritable(".secret/dummy")) {
+ } // END - if
+ if (!IS_INC_WRITEABLE(".secret/dummy")) {
ADD_FATAL(SECRET_IS_WRITE_PROTECTED);
- }
+ } // END - if
} // END - if
}
+// Init filter system
+INIT_FILTER_SYSTEM();
+
// Any fatal messages?
if (!is_array($FATAL)) $FATAL = array();
-if (((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) && (isBooleanConstantAndTrue('mxchange_installed')) && (!defined('mxchange_installing')) && ($CSS != "1"))
-{
+if (((sizeof($FATAL) > 0) || (!empty($FATAL[0]))) && (isBooleanConstantAndTrue('mxchange_installed')) && (!defined('mxchange_installing')) && ($CSS != "1")) {
// One or more fatal error(s) occur during connect...
include (PATH."inc/header.php");
include (PATH."inc/fatal_errors.php");
unset($FATAL);
include (PATH."inc/footer.php");
exit;
-}
+} // END - if
//
?>