X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmysql-connect.php;h=f52848abc04bb0db01758ac92c0ba85d5d5511af;hp=ad62a503e465398de0261406629f8cf3f7e1144c;hb=3b85bd5030ad591b0c5cb038ca534a7b50e1b319;hpb=6c763653e88b9d10627e651ca59c7201d4b7d62b diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index ad62a503e4..f52848abc0 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -43,9 +43,12 @@ define('DEBUG_SQL', false); // 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"); @@ -71,7 +74,7 @@ function __errorHandler ($errno, $errstr, $errfile, $errline) { die("Error message written to debug.log. Please try to call the main page to continue."); } else { // No debug extension found - print("Please report this error at forum.mxchange.org:
");
+		print("Please report this error at forum.mxchange.org:
");
 		debug_print_backtrace();
 		die("
Thank you for your help finding bugs."); } @@ -80,6 +83,15 @@ function __errorHandler ($errno, $errstr, $errfile, $errline) { // 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 @@ -133,8 +145,8 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT // 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"); @@ -241,7 +253,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT // Include required files require_once(PATH."inc/databases.php"); - require_once(PATH."inc/theme-manager.php"); + require_once(PATH."inc/session.php"); // Check if we are in installation routine $installPhp = basename($_SERVER['PHP_SELF']); @@ -253,29 +265,31 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT // 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 // ?>