1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/12627] Add debug.sql_explain parameter

PHPBB3-12627
This commit is contained in:
Jakub Senko
2018-06-18 20:42:16 +02:00
parent 1d0046437b
commit bdff0f5590
14 changed files with 57 additions and 30 deletions

View File

@@ -75,6 +75,11 @@ abstract class driver implements driver_interface
const SUBQUERY_SELECT_TYPE = 4;
const SUBQUERY_BUILD = 5;
/**
* @var bool
*/
protected $debug_sql_explain = false;
/**
* Constructor
*/
@@ -95,6 +100,14 @@ abstract class driver implements driver_interface
$this->one_char = chr(0) . '_';
}
/**
* {@inheritdoc}
*/
public function set_debug_sql_explain($value)
{
$this->debug_sql_explain = $value;
}
/**
* {@inheritdoc}
*/
@@ -955,7 +968,7 @@ abstract class driver implements driver_interface
// Show complete SQL error and path to administrators only
// Additionally show complete error on installation or if extended debug mode is enabled
// The DEBUG constant is for development only!
if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG'))
if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || $this->debug_sql_explain)
{
$message .= ($sql) ? '<br /><br />SQL<br /><br />' . htmlspecialchars($sql) : '';
}