Merge branch 'release/1.7.8' into develop

Conflicts:
	classes/context/Context.class.php
	config/config.inc.php
This commit is contained in:
bnu 2014-12-09 15:13:08 +09:00
commit 4506ea440e
50 changed files with 4086 additions and 126 deletions

View file

@ -845,10 +845,13 @@ function debugPrint($debug_output = NULL, $display_option = TRUE, $file = '_debu
*/
function writeSlowlog($type, $elapsed_time, $obj)
{
if(!__LOG_SLOW_TRIGGER__ && !__LOG_SLOW_ADDON__ && !__LOG_SLOW_WIDGET__ && !__LOG_SLOW_QUERY__) return;
static $log_filename = array(
'query' => 'files/_slowlog_query.php',
'trigger' => 'files/_slowlog_trigger.php',
'addon' => 'files/_slowlog_addon.php'
'addon' => 'files/_slowlog_addon.php',
'widget' => 'files/_slowlog_widget.php'
);
$write_file = true;
@ -863,6 +866,15 @@ function writeSlowlog($type, $elapsed_time, $obj)
$buff[] = "\tCaller : " . $obj->caller;
$buff[] = "\tCalled : " . $obj->called;
}
else if($type == 'addon' && __LOG_SLOW_ADDON__ > 0 && $elapsed_time > __LOG_SLOW_ADDON__)
{
$buff[] = "\tAddon : " . $obj->called;
$buff[] = "\tCalled position : " . $obj->caller;
}
else if($type == 'widget' && __LOG_SLOW_WIDGET__ > 0 && $elapsed_time > __LOG_SLOW_WIDGET__)
{
$buff[] = "\tWidget : " . $obj->called;
}
else if($type == 'query' && __LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__)
{
@ -883,15 +895,26 @@ function writeSlowlog($type, $elapsed_time, $obj)
file_put_contents($log_file, implode(PHP_EOL, $buff), FILE_APPEND);
}
$trigger_args = $obj;
$trigger_args->_log_type = $type;
$trigger_args->_elapsed_time = $elapsed_time;
if($type != 'query')
{
$trigger_args = $obj;
$trigger_args->_log_type = $type;
$trigger_args->_elapsed_time = $elapsed_time;
ModuleHandler::triggerCall('XE.writeSlowlog', 'after', $trigger_args);
}
}
/**
* @param void
*/
function flushSlowlog()
{
$trigger_args = new stdClass();
$trigger_args->_log_type = 'flush';
$trigger_args->_elapsed_time = 0;
ModuleHandler::triggerCall('XE.writeSlowlog', 'after', $trigger_args);
}
/**
* microtime() return
*