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:
@@ -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) : '';
|
||||
}
|
||||
|
Reference in New Issue
Block a user