diff options
Diffstat (limited to 'phpBB/phpbb/db')
-rw-r--r-- | phpBB/phpbb/db/driver/driver.php | 13 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/driver_interface.php | 7 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/factory.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/mssql_odbc.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/mssqlnative.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/mysql.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/mysqli.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/oracle.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/postgres.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/db/driver/sqlite3.php | 4 |
10 files changed, 42 insertions, 14 deletions
diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index ab8de73531..93f0a749e5 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -78,6 +78,11 @@ abstract class driver implements driver_interface /** * @var bool */ + protected $debug_load_time = false; + + /** + * @var bool + */ protected $debug_sql_explain = false; /** @@ -103,6 +108,14 @@ abstract class driver implements driver_interface /** * {@inheritdoc} */ + public function set_debug_load_time($value) + { + $this->debug_load_time = $value; + } + + /** + * {@inheritdoc} + */ public function set_debug_sql_explain($value) { $this->debug_sql_explain = $value; diff --git a/phpBB/phpbb/db/driver/driver_interface.php b/phpBB/phpbb/db/driver/driver_interface.php index 6602ffb4e4..05ff5ef066 100644 --- a/phpBB/phpbb/db/driver/driver_interface.php +++ b/phpBB/phpbb/db/driver/driver_interface.php @@ -16,6 +16,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 * * @param bool $value diff --git a/phpBB/phpbb/db/driver/factory.php b/phpBB/phpbb/db/driver/factory.php index 122cbcc10d..bb6e7a2682 100644 --- a/phpBB/phpbb/db/driver/factory.php +++ b/phpBB/phpbb/db/driver/factory.php @@ -68,6 +68,14 @@ class factory implements driver_interface /** * {@inheritdoc} */ + public function set_debug_load_time($value) + { + $this->get_driver()->set_debug_load_time($value); + } + + /** + * {@inheritdoc} + */ public function set_debug_sql_explain($value) { $this->get_driver()->set_debug_sql_explain($value); diff --git a/phpBB/phpbb/db/driver/mssql_odbc.php b/phpBB/phpbb/db/driver/mssql_odbc.php index 58c2863f53..06cdce7a15 100644 --- a/phpBB/phpbb/db/driver/mssql_odbc.php +++ b/phpBB/phpbb/db/driver/mssql_odbc.php @@ -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; } diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php index ff37eaf1c2..30ef9d9bc4 100644 --- a/phpBB/phpbb/db/driver/mssqlnative.php +++ b/phpBB/phpbb/db/driver/mssqlnative.php @@ -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; } diff --git a/phpBB/phpbb/db/driver/mysql.php b/phpBB/phpbb/db/driver/mysql.php index 65ec57dc14..8ce70444c2 100644 --- a/phpBB/phpbb/db/driver/mysql.php +++ b/phpBB/phpbb/db/driver/mysql.php @@ -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; } diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php index b10abeb6bd..df8b88c315 100644 --- a/phpBB/phpbb/db/driver/mysqli.php +++ b/phpBB/phpbb/db/driver/mysqli.php @@ -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; } diff --git a/phpBB/phpbb/db/driver/oracle.php b/phpBB/phpbb/db/driver/oracle.php index ab194f7c53..f2a0bb557a 100644 --- a/phpBB/phpbb/db/driver/oracle.php +++ b/phpBB/phpbb/db/driver/oracle.php @@ -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; } diff --git a/phpBB/phpbb/db/driver/postgres.php b/phpBB/phpbb/db/driver/postgres.php index 2052268921..ed330bc540 100644 --- a/phpBB/phpbb/db/driver/postgres.php +++ b/phpBB/phpbb/db/driver/postgres.php @@ -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; } diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php index a1adc97ebf..43906f1b58 100644 --- a/phpBB/phpbb/db/driver/sqlite3.php +++ b/phpBB/phpbb/db/driver/sqlite3.php @@ -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; } |