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:
committed by
Marc Alexander
parent
b4d4336ef4
commit
139eb17bb7
@@ -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;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
@@ -100,6 +105,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}
|
||||
*/
|
||||
|
@@ -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);
|
||||
|
||||
/**
|
||||
* Set value for sql_explain debug parameter
|
||||
*
|
||||
|
@@ -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}
|
||||
*/
|
||||
|
@@ -155,7 +155,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);
|
||||
}
|
||||
@@ -175,7 +175,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;
|
||||
}
|
||||
|
@@ -127,7 +127,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);
|
||||
}
|
||||
@@ -149,7 +149,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;
|
||||
}
|
||||
|
@@ -175,7 +175,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);
|
||||
}
|
||||
@@ -194,7 +194,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;
|
||||
}
|
||||
|
@@ -177,7 +177,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);
|
||||
}
|
||||
@@ -196,7 +196,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;
|
||||
}
|
||||
|
@@ -250,7 +250,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);
|
||||
}
|
||||
@@ -431,7 +431,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;
|
||||
}
|
||||
|
@@ -177,7 +177,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);
|
||||
}
|
||||
@@ -197,7 +197,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;
|
||||
}
|
||||
|
@@ -122,7 +122,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);
|
||||
}
|
||||
@@ -159,7 +159,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;
|
||||
}
|
||||
|
@@ -35,6 +35,7 @@ class container_configuration implements ConfigurationInterface
|
||||
->addDefaultsIfNotSet()
|
||||
->children()
|
||||
->booleanNode('exceptions')->defaultValue(false)->end()
|
||||
->booleanNode('load_time')->defaultValue(false)->end()
|
||||
->booleanNode('sql_explain')->defaultValue(false)->end()
|
||||
->end()
|
||||
->end()
|
||||
|
@@ -191,7 +191,6 @@ class create_config_file extends \phpbb\install\task_base
|
||||
}
|
||||
|
||||
$config_content .= "\n@define('PHPBB_INSTALLED', true);\n";
|
||||
$config_content .= "// @define('PHPBB_DISPLAY_LOAD_TIME', true);\n";
|
||||
|
||||
if ($environment)
|
||||
{
|
||||
|
Reference in New Issue
Block a user