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

[ticket/12624] Add debug.load_time parameter

PHPBB3-12624
This commit is contained in:
Jakub Senko
2018-06-18 20:35:01 +02:00
parent 1d0046437b
commit fcc3dd996d
17 changed files with 54 additions and 19 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_load_time = false;
/**
* Constructor
*/
@@ -95,6 +100,14 @@ abstract class driver implements driver_interface
$this->one_char = chr(0) . '_';
}
/**
* {@inheritdoc}
*/
public function set_debug_load_time($value)
{
$this->debug_load_time = $value;
}
/**
* {@inheritdoc}
*/

View File

@@ -15,6 +15,13 @@ namespace phpbb\db\driver;
interface driver_interface
{
/**
* Set value for load_time debug parameter
*
* @param bool $value
*/
public function set_debug_load_time($value);
/**
* Gets the name of the sql layer.
*

View File

@@ -65,6 +65,14 @@ class factory implements driver_interface
$this->driver = $driver;
}
/**
* {@inheritdoc}
*/
public function set_debug_load_time($value)
{
$this->get_driver()->set_debug_load_time($value);
}
/**
* {@inheritdoc}
*/

View File

@@ -156,7 +156,7 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
{
$this->sql_report('start', $query);
}
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
else if ($this->debug_load_time)
{
$this->curtime = microtime(true);
}
@@ -176,7 +176,7 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
{
$this->sql_report('stop', $query);
}
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
else if ($this->debug_load_time)
{
$this->sql_time += microtime(true) - $this->curtime;
}

View File

@@ -128,7 +128,7 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
{
$this->sql_report('start', $query);
}
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
else if ($this->debug_load_time)
{
$this->curtime = microtime(true);
}
@@ -150,7 +150,7 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
{
$this->sql_report('stop', $query);
}
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
else if ($this->debug_load_time)
{
$this->sql_time += microtime(true) - $this->curtime;
}

View File

@@ -176,7 +176,7 @@ class mysql extends \phpbb\db\driver\mysql_base
{
$this->sql_report('start', $query);
}
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
else if ($this->debug_load_time)
{
$this->curtime = microtime(true);
}
@@ -195,7 +195,7 @@ class mysql extends \phpbb\db\driver\mysql_base
{
$this->sql_report('stop', $query);
}
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
else if ($this->debug_load_time)
{
$this->sql_time += microtime(true) - $this->curtime;
}

View File

@@ -178,7 +178,7 @@ class mysqli extends \phpbb\db\driver\mysql_base
{
$this->sql_report('start', $query);
}
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
else if ($this->debug_load_time)
{
$this->curtime = microtime(true);
}
@@ -197,7 +197,7 @@ class mysqli extends \phpbb\db\driver\mysql_base
{
$this->sql_report('stop', $query);
}
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
else if ($this->debug_load_time)
{
$this->sql_time += microtime(true) - $this->curtime;
}

View File

@@ -251,7 +251,7 @@ class oracle extends \phpbb\db\driver\driver
{
$this->sql_report('start', $query);
}
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
else if ($this->debug_load_time)
{
$this->curtime = microtime(true);
}
@@ -432,7 +432,7 @@ class oracle extends \phpbb\db\driver\driver
{
$this->sql_report('stop', $query);
}
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
else if ($this->debug_load_time)
{
$this->sql_time += microtime(true) - $this->curtime;
}

View File

@@ -178,7 +178,7 @@ class postgres extends \phpbb\db\driver\driver
{
$this->sql_report('start', $query);
}
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
else if ($this->debug_load_time)
{
$this->curtime = microtime(true);
}
@@ -198,7 +198,7 @@ class postgres extends \phpbb\db\driver\driver
{
$this->sql_report('stop', $query);
}
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
else if ($this->debug_load_time)
{
$this->sql_time += microtime(true) - $this->curtime;
}

View File

@@ -123,7 +123,7 @@ class sqlite3 extends \phpbb\db\driver\driver
{
$this->sql_report('start', $query);
}
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
else if ($this->debug_load_time)
{
$this->curtime = microtime(true);
}
@@ -160,7 +160,7 @@ class sqlite3 extends \phpbb\db\driver\driver
{
$this->sql_report('stop', $query);
}
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
else if ($this->debug_load_time)
{
$this->sql_time += microtime(true) - $this->curtime;
}