Completely disable Debug logging if it is not enabled for the current user

관리자 또는 특정 IP에서만 디버그 기능을 사용하도록 설정된 경우,
그 밖의 요청에서는 어떤 에러메시지, 쿼리, 트리거 소요시간 등의 기록도
디버그 클래스에 저장하지 않도록 변경합니다.

워닝이 많이 발생하는 PHP 8.0에서는 20~30%의 성능 개선 효과가 있습니다.
This commit is contained in:
Kijin Sung 2021-01-07 02:51:43 +09:00
parent 02122cb383
commit 1a204d8c52
11 changed files with 108 additions and 74 deletions

View file

@ -130,7 +130,7 @@ class addonController extends addon
$buff[] = 'if ($run && file_exists($addon_file)):';
$buff[] = ' include($addon_file);';
$buff[] = ' $after_time = microtime(true);';
$buff[] = ' if (class_exists("Rhymix\\\\Framework\\\\Debug")):';
$buff[] = ' if (class_exists("Rhymix\\\\Framework\\\\Debug") && Rhymix\\Framework\\Debug::isEnabledForCurrentUser()):';
$buff[] = ' Rhymix\\Framework\\Debug::addTrigger(array(';
$buff[] = ' "name" => "addon." . $called_position,';
$buff[] = ' "target" => "' . $addon . '",';