Remove old debug constants

This commit is contained in:
Kijin Sung 2016-02-13 11:19:13 +09:00
parent 968e25cd6e
commit 6b4d69bcc2
14 changed files with 29 additions and 228 deletions

View file

@ -383,24 +383,12 @@ class DB
}
}
// leave error log if an error occured (if __DEBUG_DB_OUTPUT__ is defined)
// leave error log if an error occured
if($this->isError())
{
$log['result'] = 'error';
$log['errno'] = $this->errno;
$log['errstr'] = $this->errstr;
if(__DEBUG_DB_OUTPUT__ == 1)
{
$debug_file = _XE_PATH_ . "files/_debug_db_query.php";
$buff = array();
if(!file_exists($debug_file))
{
$buff[] = '<?php exit(); ?' . '>';
}
$buff[] = print_r($log, TRUE);
@file_put_contents($log_file, implode("\n", $buff) . "\n\n", FILE_APPEND|LOCK_EX);
}
}
else
{

View file

@ -971,8 +971,6 @@ class DBCubrid extends DB
return;
}
$query .= (__DEBUG_QUERY__ & 1 && $this->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : '';
$result = $this->_query($query);
if($result && !$this->transaction_started)
{
@ -1002,8 +1000,6 @@ class DBCubrid extends DB
return;
}
$query .= (__DEBUG_QUERY__ & 1 && $this->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : '';
$result = $this->_query($query);
if($result && !$this->transaction_started)
@ -1034,8 +1030,6 @@ class DBCubrid extends DB
return;
}
$query .= (__DEBUG_QUERY__ & 1 && $this->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : '';
$result = $this->_query($query);
if($result && !$this->transaction_started)
@ -1077,7 +1071,6 @@ class DBCubrid extends DB
return;
}
$query .= (__DEBUG_QUERY__ & 1 && $this->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : '';
$result = $this->_query($query, $connection);
if($this->isError())
@ -1147,7 +1140,6 @@ class DBCubrid extends DB
$count_query = sprintf('select count(*) as "count" from (%s) xet', $count_query);
}
$count_query .= (__DEBUG_QUERY__ & 1 && $queryObject->queryID) ? sprintf(' ' . $this->comment_syntax, $queryObject->queryID) : '';
$result = $this->_query($count_query, $connection);
$count_output = $this->_fetch($result);
$total_count = (int) (isset($count_output->count) ? $count_output->count : NULL);
@ -1195,7 +1187,6 @@ class DBCubrid extends DB
$start_count = ($page - 1) * $list_count;
$query = $this->getSelectPageSql($queryObject, $with_values, $start_count, $list_count);
$query .= (__DEBUG_QUERY__ & 1 && $queryObject->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : '';
$result = $this->_query($query, $connection);
if($this->isError())
{

View file

@ -943,8 +943,6 @@ class DBMssql extends DB
// TODO Decide if we continue to pass parameters like this
$this->param = $queryObject->getArguments();
$query .= (__DEBUG_QUERY__ & 1 && $output->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : '';
$result = $this->_query($query, $connection);
if($this->isError())
@ -1024,7 +1022,6 @@ class DBMssql extends DB
$count_query = sprintf('select count(*) as "count" from (%s) xet', $count_query);
}
$count_query .= (__DEBUG_QUERY__ & 1 && $queryObject->queryID) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : '';
$this->param = $queryObject->getArguments();
$result_count = $this->_query($count_query, $connection);
$count_output = $this->_fetch($result_count);

View file

@ -689,7 +689,6 @@ class DBMysql extends DB
function _executeInsertAct($queryObject, $with_values = true)
{
$query = $this->getInsertSql($queryObject, $with_values, true);
$query .= (__DEBUG_QUERY__ & 1 && $this->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : '';
if(is_a($query, 'Object'))
{
return;
@ -711,10 +710,6 @@ class DBMysql extends DB
if(!$query->toBool()) return $query;
else return;
}
$query .= (__DEBUG_QUERY__ & 1 && $this->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : '';
return $this->_query($query);
}
@ -727,7 +722,6 @@ class DBMysql extends DB
function _executeDeleteAct($queryObject, $with_values = true)
{
$query = $this->getDeleteSql($queryObject, $with_values, true);
$query .= (__DEBUG_QUERY__ & 1 && $this->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : '';
if(is_a($query, 'Object'))
{
return;
@ -759,7 +753,6 @@ class DBMysql extends DB
{
return;
}
$query .= (__DEBUG_QUERY__ & 1 && $queryObject->queryID) ? sprintf(' ' . $this->comment_syntax, $queryObject->queryID) : '';
$result = $this->_query($query, $connection);
if($this->isError())
@ -880,7 +873,6 @@ class DBMysql extends DB
$count_query = sprintf('select count(*) as "count" from (%s) xet', $count_query);
}
$count_query .= (__DEBUG_QUERY__ & 1 && $queryObject->queryID) ? sprintf(' ' . $this->comment_syntax, $queryObject->queryID) : '';
$result_count = $this->_query($count_query, $connection);
$count_output = $this->_fetch($result_count);
$total_count = (int) (isset($count_output->count) ? $count_output->count : NULL);
@ -927,7 +919,6 @@ class DBMysql extends DB
$query = $this->getSelectPageSql($queryObject, $with_values, $start_count, $list_count);
$query .= (__DEBUG_QUERY__ & 1 && $queryObject->query_id) ? sprintf(' ' . $this->comment_syntax, $this->query_id) : '';
$result = $this->_query($query, $connection);
if($this->isError())
{

View file

@ -1184,11 +1184,7 @@ class ModuleHandler extends Handler
}
//store before trigger call time
$before_trigger_time = NULL;
if(__LOG_SLOW_TRIGGER__> 0)
{
$before_trigger_time = microtime(true);
}
$before_trigger_time = microtime(true);
foreach($triggers as $item)
{