-// Call-back function for running shutdown functions and close database connection
-function __SHUTDOWN_HOOK () {
- global $link;
-
- // Call the filter chain 'shutdown'
- RUN_FILTER('shutdown', null, false);
-
- if (is_resource($link)) {
- // Close link
- SQL_CLOSE($link, __FILE__, __LINE__);
- } else {
- // No database link
- addFatalMessage(NO_DB_LINK);
- }
-}
-
-// Register shutdown hook
-register_shutdown_function('__SHUTDOWN_HOOK');
-
-// 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
- OUTPUT_HTML("<strong>{!LANG_WARNING!}:</strong> ");
- if (isBooleanConstantAndTrue('mxchange_installed')) {
- // You have changed my configuration file!
- mxchange_die("{!DIE_CONFIG_CHANGED_YOU!}");
- } else {
- // Please run the installation script (maybe again)
- mxchange_die("{!DIE_RUN_INSTALL_MYSQL!}");
- }
-} elseif ((!isBooleanConstantAndTrue('mxchange_installing')) && (!isset($_GET['installing'])) && (empty($MySQL['password'])) && (isBooleanConstantAndTrue('warn_no_pass'))) {
- // No database password entered!!!
- OUTPUT_HTML("<div>{!LANG_WARNING!}:</div> {!WARN_NULL_PASSWORD!}");
-}
-
-// Set dummy $_CONFIG array
-$_CONFIG = array(
- 'code_length' => 0,
- 'patch_level' => 0,
- 'last_update' => time()
-);
-
-// Init important $header variable
-global $header;
-$header = 0;