mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 11:44:10 +09:00
Only use error handler and slowlog when debugging is enabled
This commit is contained in:
parent
6b4d69bcc2
commit
51f985c215
3 changed files with 56 additions and 32 deletions
|
|
@ -138,39 +138,11 @@ class DisplayHandler extends Handler
|
|||
public function getDebugInfo(&$output)
|
||||
{
|
||||
// Check if debugging is enabled for this request.
|
||||
if (!config('debug.enabled'))
|
||||
if (!config('debug.enabled') || !Rhymix\Framework\Debug::isEnabledForCurrentUser())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if debugging info should be visible to the current user.
|
||||
$display_to = config('debug.display_to');
|
||||
switch ($display_to)
|
||||
{
|
||||
case 'everyone':
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
$allowed_ip = config('debug.allow');
|
||||
foreach ($allowed_ip as $range)
|
||||
{
|
||||
if (Rhymix\Framework\IpFilter::inRange(RX_CLIENT_IP, $range))
|
||||
{
|
||||
break 2;
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
case 'admin':
|
||||
default:
|
||||
$logged_info = Context::get('logged_info');
|
||||
if ($logged_info && $logged_info->is_admin === 'Y')
|
||||
{
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Print debug information.
|
||||
switch ($display_type = config('debug.display_type'))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue