$message, 'value'=>$value); } } public static function getLog($type) { if(isset(self::$data[$type])) { return self::$data[$type]; } else { return array(); } } public static function navigator() { if(self::init()) { if(isset($_GET['profileError'])) { if($_GET['profileError'] == 'true') { setcookie('error',1 , 0, '/'); }else { setcookie('error',null , 0, '/'); unset($_COOKIE['error']); } } if(isset($_COOKIE['error'])) { error_reporting(E_ALL); ini_set('display_errors', true); } if(isset($_GET['profileSql'])) { if($_GET['profileSql'] == 'true') { setcookie('sql',1 , 0, '/'); }else { setcookie('sql',null , 0, '/'); unset($_COOKIE['sql']); } } if(isset($_GET['profilePhp'])) { if($_GET['profilePhp'] == 'true') { setcookie('php',1 , 0, '/'); }else { setcookie('php',null , 0, '/'); unset($_COOKIE['php']); } } } } public static function debugInfo() { if(self::init()) { self::pageInfo(); $showError = false; if(isset($_COOKIE['error'])) { $showError = true; } if(isset($_GET['profileError'])) { if($_GET['profileError'] == 'true') { $showError = true; } else { $showError = false; } } $showSql = false; if(isset($_COOKIE['sql'])) { $showSql = true; } if(isset($_GET['profileSql'])) { if($_GET['profileSql'] == 'true') { $showSql = true; } else { $showSql = false; } } $showPhp = false; if(isset($_COOKIE['php'])) { $showPhp = true; } if(isset($_GET['profilePhp'])) { if($_GET['profilePhp'] == 'true') { $showPhp = true; } else { $showPhp = false; } } if($showSql) { self::sqlDisplay(); } if($showPhp) { self::phpInfoDisplay(); } self::commonDisplay(); } } private static function commonDisplay() { ?>
"; $totalTime = 0; foreach($queries as $query) { ?> Czas nawiazania polaczenia: ".date("Y-d-m h:i:s", mktime(abs($sqlStart[0]['value']))).""; echo"Czas trwania polaczenia: ".$sqlTime."";} echo"

"; echo""; } } private static function phpInfoDisplay() { phpinfo(); } private static function init() { $return = false; if(self::$profiling) { $return = true; } if(in_array($_SERVER['REMOTE_ADDR'], self::$clientIp) && self::$profiling) { $return = true; } else { $return = false; } return $return; } } ?>