$v) { $msg['sql'] = str_replace($k, $v, $msg['sql']); } unset($msg['value']); } if(is_array($msg)) $msg = var_export($msg, true); self::add('log', $msg . "\r\n" . self::time() . "\r\n" . self::memory() . "\r\n" ); } } /** * runtime * * @return string */ static public function runtime() { self::log('Total'); self::log('Total' . "\r\n" . self::loadfile()); } /** * time * * @return string */ static private function time() { list($a, $b) = explode(' ', MAZE_START); $s = ((float)$a + (float)$b); list($a, $b) = explode(' ', microtime()); $e = ((float)$a + (float)$b); return '[time:' . ($e - $s) . 'S]'; } /** * memory * * @return string */ static private function memory() { return '[memory:' . (memory_get_usage()/1024) . 'KB]'; } /** * loadfile * * @return string */ static private function loadfile() { return '[file:' . var_export(get_included_files(), true) . ']'; } /** * add * * @return string */ static private function add($method, $msg) { //Tool::$method($msg); self::$data[$method][] = $msg; } /** * wait * * @return array */ static public function wait() { echo self::html('');die; } /** * data * * @return string */ static public function data() { if(self::init() == 1) { echo self::html(''); } } /** * html * * @return string */ static public function html($show = 'display:none;') { self::runtime(); $fix = 'fixed'; if(!$show) { $fix = ''; } $html = '
'; if(self::$data) { foreach(self::$data as $k => $v) { $html .= '' . $k . ''; $html .= '
'; $html .= ''; foreach($v as $i => $j) { $html .= ''; $html .= ''; $html .= ''; } $html .= '
' . $j . '
'; $html .= '
'; } } $html .= '
'; return $html; } }