Skip to content

Commit

Permalink
refs #1669 : modified - debug module support / static URL
Browse files Browse the repository at this point in the history
 - static URI now points https URI
  • Loading branch information
inureyes committed May 12, 2014
1 parent 960d85f commit 67f9ff0
Show file tree
Hide file tree
Showing 5 changed files with 517 additions and 63 deletions.
57 changes: 30 additions & 27 deletions framework/data/MySQL/Debug.php
Expand Up @@ -84,7 +84,7 @@ function __tcSqlLogEnd( $result, $cachedResult = 0 )
function __tcSqlLogPoint($description = null)
{
global $__tcSqlLog, $__tcSqlQueryBeginTime, $__tcSqlLogCount, $__tcPageStartTime, $__tcPageEndTime;
if (is_null($description)) $description = 'Point';
if (is_null($description)) $description = 'Point';
$backtrace = debug_backtrace();
array_shift($backtrace);
array_shift($backtrace);
Expand Down Expand Up @@ -126,14 +126,14 @@ function __tcSqlLogDump()
global $__tcSqlLog, $__tcPageEndTime;
global $service;
static $sLogPumped = false;

if (!empty($sLogPumped)) return;
$sLogPumped = true;

__tcSqlLogPoint('shutdown');

$headers = array();

if (function_exists('apache_response_headers') || function_exists('headers_list')) {
if (function_exists('apache_response_headers')) {
flush();
Expand All @@ -142,11 +142,11 @@ function __tcSqlLogDump()
$headers = headers_list();
}
}

$commentBlosk = false;

foreach ($headers as $row) {
if (strpos($row, '/xml') !== false || strpos($row, '+xml') !== false) {
if (strpos($row, '/xml') !== false || strpos($row, '+xml') !== false) {
/* To check text/xml, application/xml and application/xml+blah, application/blah+xml... types */
$commentBlosk = true;
break;
Expand All @@ -155,9 +155,9 @@ function __tcSqlLogDump()
return;
}
}

if ($commentBlosk == true) echo '<!--';

if (!$commentBlosk) {
print <<<EOS
<style type='text/css'>
Expand All @@ -170,14 +170,14 @@ function __tcSqlLogDump()
border-collapse: collapse;
margin-bottom: 20px;
}
.debugTable *
{
border: none;
margin: 0;
padding: 0;
}
.debugTable td, .debugTable th
{
border-bottom: 1px solid #999;
Expand All @@ -187,7 +187,7 @@ function __tcSqlLogDump()
font-size: 12px;
padding: 3px 5px;
}
.debugTable th
{
background-color: #dedede;
Expand All @@ -203,53 +203,53 @@ function __tcSqlLogDump()
{
text-align: center;
}
tr.debugSQLLine .error
{
text-align: left;
}
tr.debugSQLLine .elapsed, tr.debugSQLLine .elapsedSum
{
text-align: right;
}
tr.debugSQLLine .backtrace
{
font-family: Courier, 'Courier new', monospace;
font-size: 11px;
letter-spacing: -1px;
}
tr.debugCached *, tr.debugSystem *
{
color: #888888 !important;
}
/* warning */
tr.debugWarning *
{
background-color: #fefff1;
color: #4b4b3b !important;
}
tr.debugWarning th
{
background-color: #e5e5ca;
}
/* error */
tr.debugError *
{
background-color: #fee5e5;
color: #961f1d !important;
}
tr.debugError th
{
background-color: #fccbca;
}
tfoot td
{
padding: 15px !important;
Expand Down Expand Up @@ -298,7 +298,7 @@ function __tcSqlLogDump()
if( $log['errno'] ) {
$error = "Error no. {$log['errno']} : {$log['error']}";
}

$trclass = '';
$count_label = $count;
if (!empty($error)) {
Expand All @@ -322,7 +322,7 @@ function __tcSqlLogDump()
$count_label = '';
$backtrace = '';
}

$elapsed_total_db += $log['elapsed'];
$elapsed_total = $log['endtime'];
$progress_bar = $log['percent'] / 2; //Max 50px;
Expand Down Expand Up @@ -352,15 +352,15 @@ function __tcSqlLogDump()
{$backtrace}
TBODY;
}

if( $log['cached'] < 2 ) {
$count++;
}
}

$count--;
$real_query_count = $count - $cached_count;

if (!$commentBlosk) {
print '</tbody>';
print <<<TFOOT
Expand All @@ -379,6 +379,9 @@ function __tcSqlLogDump()
global $service, $URLInfo, $suri, $database;
print '<div class="debugTable">'.CRLF;
print '<h4>Current Database Management System :</h4>'.CRLF.'<p>'.POD::dbms().'</p>'.CRLF;
print '<h4>SSL support : </h4>'.CRLF;
if(isset($service['useSSL']) && $service['useSSL'] == true) print '<p>Enabled</p>'.CRLF;
else print '<p>Disabled</p>'.CRLF;
print '<h4>Cache system :</h4>'.CRLF.'<ul>'.CRLF;
if(isset($service['pagecache']) && $service['pagecache'] == true) print '<li>Page cache Enabled</li>'.CRLF;
else print '<li>Page cache Disabled</li>'.CRLF;
Expand Down
57 changes: 30 additions & 27 deletions framework/data/MySQLi/Debug.php
Expand Up @@ -85,7 +85,7 @@ function __tcSqlLogEnd( $result, $cachedResult = 0 )
function __tcSqlLogPoint($description = null)
{
global $__tcSqlLog, $__tcSqlQueryBeginTime, $__tcSqlLogCount, $__tcPageStartTime, $__tcPageEndTime;
if (is_null($description)) $description = 'Point';
if (is_null($description)) $description = 'Point';
$backtrace = debug_backtrace();
array_shift($backtrace);
array_shift($backtrace);
Expand Down Expand Up @@ -129,11 +129,11 @@ function __tcSqlLogDump()
static $sLogPumped = false;
if (!empty($sLogPumped)) return;
$sLogPumped = true;

__tcSqlLogPoint('shutdown');

$headers = array();

if (function_exists('apache_response_headers') || function_exists('headers_list')) {
if (function_exists('apache_response_headers')) {
flush();
Expand All @@ -142,11 +142,11 @@ function __tcSqlLogDump()
$headers = headers_list();
}
}

$commentBlosk = false;

foreach ($headers as $row) {
if (strpos($row, '/xml') !== false || strpos($row, '+xml') !== false) {
if (strpos($row, '/xml') !== false || strpos($row, '+xml') !== false) {
/* To check text/xml, application/xml and application/xml+blah, application/blah+xml... types */
$commentBlosk = true;
break;
Expand All @@ -155,9 +155,9 @@ function __tcSqlLogDump()
return;
}
}

if ($commentBlosk == true) echo '<!--';

if (!$commentBlosk) {
print <<<EOS
<style type='text/css'>
Expand All @@ -170,14 +170,14 @@ function __tcSqlLogDump()
border-collapse: collapse;
margin-bottom: 20px;
}
.debugTable *
{
border: none;
margin: 0;
padding: 0;
}
.debugTable td, .debugTable th
{
border-bottom: 1px solid #999;
Expand All @@ -187,64 +187,64 @@ function __tcSqlLogDump()
font-size: 12px;
padding: 3px 5px;
}
.debugTable th
{
background-color: #dedede;
text-align: center;
}
tr.debugSQLLine .rows
{
text-align: center;
}
tr.debugSQLLine .error
{
text-align: left;
}
tr.debugSQLLine .elapsed, tr.debugSQLLine .elapsedSum
{
text-align: right;
}
tr.debugSQLLine .backtrace
{
font-family: Courier, 'Courier new', monospace;
font-size: 11px;
letter-spacing: -1px;
}
tr.debugCached *, tr.debugSystem *
{
color: #888888 !important;
}
/* warning */
tr.debugWarning *
{
background-color: #fefff1;
color: #4b4b3b !important;
}
tr.debugWarning th
{
background-color: #e5e5ca;
}
/* error */
tr.debugError *
{
background-color: #fee5e5;
color: #961f1d !important;
}
tr.debugError th
{
background-color: #fccbca;
}
tfoot td
{
padding: 15px !important;
Expand Down Expand Up @@ -293,7 +293,7 @@ function __tcSqlLogDump()
if( $log['errno'] ) {
$error = "Error no. {$log['errno']} : {$log['error']}";
}

$trclass = '';
$count_label = $count;
if (!empty($error)) {
Expand All @@ -317,7 +317,7 @@ function __tcSqlLogDump()
$count_label = '';
$backtrace = '';
}

$elapsed_total_db += $log['elapsed'];
$elapsed_total = $log['endtime'];
$progress_bar = $log['percent'] / 2; //Max 50px;
Expand Down Expand Up @@ -347,15 +347,15 @@ function __tcSqlLogDump()
{$backtrace}
TBODY;
}

if( $log['cached'] < 2 ) {
$count++;
}
}

$count--;
$real_query_count = $count - $cached_count;

if (!$commentBlosk) {
print '</tbody>';
print <<<TFOOT
Expand All @@ -374,6 +374,9 @@ function __tcSqlLogDump()
global $service, $URLInfo, $suri;
print '<div class="debugTable">'.CRLF;
print '<h4>Current Database Management System :</h4>'.CRLF.'<p>'.POD::dbms().' '.POD::version().'</p>'.CRLF;
print '<h4>SSL support : </h4>'.CRLF;
if(isset($service['useSSL']) && $service['useSSL'] == true) print '<p>Enabled</p>'.CRLF;
else print '<p>Disabled</p>'.CRLF;
print '<h4>Cache system :</h4>'.CRLF;
if(isset($service['pagecache']) && $service['pagecache'] == true) print '<p>Page cache Enabled</p>'.CRLF;
else print '<p>Page cache Disabled</p>'.CRLF;
Expand Down

0 comments on commit 67f9ff0

Please sign in to comment.