//Mysql Debug Cookie $GLOBALS['enableDebug'] = false; if (42 == $_COOKIE["enableDebug"]) { $GLOBALS['enableDebug'] = true; } require_once "server_vars.inc.php"; require_once "constants.inc.php"; require_once 'mysql2_array.inc.php'; require_once 'error_handling.inc.php'; //Enabled when debugging //if( $GLOBALS['enableDebug'] ){ register_shutdown_function('outputMysqlDebug'); //} require_once 'memcached.inc.php'; //if (McGetMysqlThreadsMonitor()) { // require_once "mysql2_with_debug.inc.php"; //} else { require_once "mysql2_no_debug.inc.php"; //} function outputMysqlDebug() { //debug на счупени заявки if (false == $GLOBALS['enableDebug']) { if (isset($GLOBALS['mysqlDebug']['queries'])) { ob_start(); } else { return true; } } if (isset($GLOBALS['outputDebug']) && $GLOBALS['outputDebug'] === false) { return true; } if (!isset($GLOBALS['mysqlDebug'])) { // in case mysql wasn't used $GLOBALS['mysqlDebug']['totalTime'] = 0; $GLOBALS['mysqlDebug']['masterConnections'] = array(); $GLOBALS['mysqlDebug']['slaveConnections'] = array(); $GLOBALS['mysqlDebug']['queries'] = array(); } $total_script_time = (isset($GLOBALS['time_start']) ? (microtime(true) - $GLOBALS['time_start']) : false); echo ''; echo '
';
echo '
'; echo '
'; echo '
'; echo ' | ';
echo '
| |||||||||||||||||||||||
| N | Tree | db_specified | query | error | сек |
|---|---|---|---|---|---|
| ' . $i . ' | ' . $value['tree'] . ' | ' . $value['db_specified'] . ' | ' . $value['query'] . ' | ' . $value['error'] . ' | ' . $value['time'] . ' |
| ' . round($GLOBALS['mysqlDebug']['totalTime'], 4) . ' | |||||
| key | value |
|---|---|
| ' . $key . ' | ' . var_export($value, true) . ' |
"; echo ""; $messages = ob_get_contents(); ob_end_clean(); $GetPageCount_sql = " SELECT error FROM " . MAIN_DB . ".intranet_mysql_debug WHERE file = " . quote_smart($_SERVER['SCRIPT_NAME']) . " "; list($error) = moon_mysql_fetch_row(moon_mysql_query($GetPageCount_sql, $GLOBALS['db_main'])); if ($error <= 1 OR is_on_dev_server()) { $headers = 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-type: text/html; charset=utf8' . "\n"; $srv = $_SERVER["HTTP_HOST"]; $srv = explode(".", $srv); if (isset($srv[0])) { $srv = "[" . strtoupper($srv[0]) . "]"; } else { $srv = ""; } mail("debug@vbox7.com", "Vbox7 - MySQL ERROR - " . $srv , $messages, $headers); } $SetPageError_sql = " INSERT INTO " . MAIN_DB . ".intranet_mysql_debug (file, error, dt) VALUES (" . quote_smart($_SERVER['SCRIPT_NAME']) . ", 1, NOW()) ON DUPLICATE KEY UPDATE error = error + 1, dt = NOW() "; moon_mysql_query($SetPageError_sql, $GLOBALS['db_main']); } } ?>
GET = "; var_dump($_GET); echo "\nPOST = "; var_dump($_POST); echo "\nSESSION = "; var_dump($_SESSION); echo "\nSERVER = "; var_dump($_SERVER); echo "\nCOOKIE = "; var_dump($_COOKIE); echo "