mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
Always save debugging information even if DisplayHandler is not invoked
This commit is contained in:
parent
b6083c02fa
commit
71724bb9fa
2 changed files with 27 additions and 2 deletions
|
|
@ -448,6 +448,12 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function close()
|
public static function close()
|
||||||
{
|
{
|
||||||
|
// Save debugging information.
|
||||||
|
if (!DisplayHandler::$debug_printed)
|
||||||
|
{
|
||||||
|
DisplayHandler::getDebugInfo();
|
||||||
|
}
|
||||||
|
|
||||||
// Check session status and close it if open.
|
// Check session status and close it if open.
|
||||||
if (self::checkSessionStatus())
|
if (self::checkSessionStatus())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
class DisplayHandler extends Handler
|
class DisplayHandler extends Handler
|
||||||
{
|
{
|
||||||
public static $response_size = 0;
|
public static $response_size = 0;
|
||||||
|
public static $debug_printed = 0;
|
||||||
var $content_size = 0; // /< The size of displaying contents
|
var $content_size = 0; // /< The size of displaying contents
|
||||||
var $gz_enabled = FALSE; // / <a flog variable whether to call contents after compressing by gzip
|
var $gz_enabled = FALSE; // / <a flog variable whether to call contents after compressing by gzip
|
||||||
var $handler = NULL;
|
var $handler = NULL;
|
||||||
|
|
@ -136,16 +137,34 @@ class DisplayHandler extends Handler
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getDebugInfo(&$output)
|
public function getDebugInfo(&$output = null)
|
||||||
{
|
{
|
||||||
|
// Check if debugging information has already been printed.
|
||||||
|
|
||||||
|
if (self::$debug_printed)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self::$debug_printed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if debugging is enabled for this request.
|
// Check if debugging is enabled for this request.
|
||||||
if (!config('debug.enabled') || !Rhymix\Framework\Debug::isEnabledForCurrentUser())
|
if (!config('debug.enabled') || !Rhymix\Framework\Debug::isEnabledForCurrentUser())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not display debugging information if there is no output.
|
||||||
|
$display_type = config('debug.display_type');
|
||||||
|
if ($output === null && $display_type !== 'file')
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Print debug information.
|
// Print debug information.
|
||||||
switch ($display_type = config('debug.display_type'))
|
switch ($display_type)
|
||||||
{
|
{
|
||||||
case 'panel':
|
case 'panel':
|
||||||
$data = Rhymix\Framework\Debug::getDebugData();
|
$data = Rhymix\Framework\Debug::getDebugData();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue