diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 6c36d2c52eb..54d3c43a873 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -38,7 +38,7 @@ if (! empty($_SERVER['DOL_TUNING']))
{
list($usec, $sec) = explode(" ", microtime());
$micro_start_time=((float)$usec + (float)$sec);
- // Add Xdebug coverage of code
+ // Add Xdebug code coverage
//define('XDEBUGCOVERAGE',1);
if (defined('XDEBUGCOVERAGE')) { xdebug_start_code_coverage(); }
}
@@ -137,6 +137,7 @@ session_start();
// This include will set: $conf, $db, $langs, $user, $mysoc objects
require_once("master.inc.php");
+register_shutdown_function('dol_shutdown');
// Detection browser
// TODO rename conf->browser into user->browser
@@ -1524,33 +1525,10 @@ if (! function_exists("llxFooter"))
print "\n".' '."\n";
if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print ' '."\n";
+ print "\n";
+ if ($foot) print ''."\n";
- if (! empty($_SERVER['DOL_TUNING']))
- {
- $micro_end_time=dol_microtime_float(true);
- print "\n".''."\n";
-
- // Add Xdebug coverage of code
- if (defined('XDEBUGCOVERAGE')) { var_dump(xdebug_get_code_coverage()); }
- }
+ if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER."\n";
// If there is some logs in buffer to show
@@ -1567,11 +1545,33 @@ if (! function_exists("llxFooter"))
print "End of log output -->\n";
}
- print "\n";
- if ($foot) print ''."\n";
-
- if (! empty($conf->global->MAIN_HTML_FOOTER)) print $conf->global->MAIN_HTML_FOOTER."\n";
+ // End of tuning
+ if (! empty($_SERVER['DOL_TUNING']))
+ {
+ $micro_end_time=dol_microtime_float(true);
+ print "\n".''."\n";
+ // Add Xdebug coverage of code
+ if (defined('XDEBUGCOVERAGE')) { var_dump(xdebug_get_code_coverage()); }
+ }
print "