/** * 输出数据 * */ public function display() { header('Content-Type: application/json;charset=' . Config::get('default_charset')); if (Cml::$debug) { $sql = Debug::getSqls(); if (Config::get('dump_use_php_console')) { $sql && \Cml\dumpUsePHPConsole($sql, 'sql'); \Cml\dumpUsePHPConsole(Debug::getTipInfo(), 'tipInfo'); \Cml\dumpUsePHPConsole(Debug::getIncludeFiles(), 'includeFile'); } else { if (isset($sql[0])) { $this->args['sql'] = implode($sql, ', '); } } } else { $deBugLogData = \Cml\dump('', 1); if (!empty($deBugLogData)) { Config::get('dump_use_php_console') ? \Cml\dumpUsePHPConsole($deBugLogData, 'debug') : ($this->args['cml_debug_info'] = $deBugLogData); } } exit(json_encode($this->args, JSON_UNESCAPED_UNICODE)); }
/** * 输出调试消息 * * @return void */ public function stopAndShowDebugInfo() { if (Request::isAjax()) { if (Config::get('dump_use_php_console')) { self::$sql && \Cml\dumpUsePHPConsole(self::$sql, 'sql'); \Cml\dumpUsePHPConsole(self::$tipInfo, 'tipInfo'); \Cml\dumpUsePHPConsole(self::$includeFile, 'includeFile'); } else { $deBugLogData = ['tipInfo' => self::$tipInfo]; self::$sql && ($deBugLogData['sql'] = self::$sql); if (!empty($deBugLogData)) { Cml::requireFile(CML_CORE_PATH . DIRECTORY_SEPARATOR . 'ConsoleLog.php', ['deBugLogData' => $deBugLogData]); } } } else { View::getEngine('html')->assign('includeLib', Debug::getIncludeLib())->assign('includeFile', Debug::getIncludeFiles())->assign('tipInfo', Debug::getTipInfo())->assign('sqls', Debug::getSqls())->assign('usetime', Debug::getUseTime())->assign('usememory', Debug::getUseMemory()); Cml::showSystemTemplate(Config::get('debug_page')); } }