aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJakub Senko <jakubsenko@gmail.com>2018-06-18 20:35:01 +0200
committerMarc Alexander <admin@m-a-styles.de>2019-05-09 18:40:15 +0200
commit139eb17bb729763ab670fb239c77db02e29920f6 (patch)
treece514d6f36d0855c9be0d5a2ed35aa14258ba6ce /phpBB
parentb4d4336ef4043a5b3381a9e70d3bbc6bc6732d07 (diff)
downloadforums-139eb17bb729763ab670fb239c77db02e29920f6.tar
forums-139eb17bb729763ab670fb239c77db02e29920f6.tar.gz
forums-139eb17bb729763ab670fb239c77db02e29920f6.tar.bz2
forums-139eb17bb729763ab670fb239c77db02e29920f6.tar.xz
forums-139eb17bb729763ab670fb239c77db02e29920f6.zip
[ticket/12624] Add debug.load_time parameter
PHPBB3-12624
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/common.php2
-rw-r--r--phpBB/config/development/config.yml1
-rw-r--r--phpBB/includes/functions.php2
-rw-r--r--phpBB/phpbb/db/driver/driver.php13
-rw-r--r--phpBB/phpbb/db/driver/driver_interface.php7
-rw-r--r--phpBB/phpbb/db/driver/factory.php8
-rw-r--r--phpBB/phpbb/db/driver/mssql_odbc.php4
-rw-r--r--phpBB/phpbb/db/driver/mssqlnative.php4
-rw-r--r--phpBB/phpbb/db/driver/mysql.php4
-rw-r--r--phpBB/phpbb/db/driver/mysqli.php4
-rw-r--r--phpBB/phpbb/db/driver/oracle.php4
-rw-r--r--phpBB/phpbb/db/driver/postgres.php4
-rw-r--r--phpBB/phpbb/db/driver/sqlite3.php4
-rw-r--r--phpBB/phpbb/di/extension/container_configuration.php1
-rw-r--r--phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php1
15 files changed, 46 insertions, 17 deletions
diff --git a/phpBB/common.php b/phpBB/common.php
index a9a5139995..230afd44e0 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -133,7 +133,7 @@ $phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
$phpbb_container->get('dbal.conn')->set_debug_sql_explain($phpbb_container->getParameter('debug.sql_explain'));
-
+$phpbb_container->get('dbal.conn')->set_debug_load_time($phpbb_container->getParameter('debug.load_time'));
require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
register_compatibility_globals();
diff --git a/phpBB/config/development/config.yml b/phpBB/config/development/config.yml
index 44517cf5e0..e7c4f77242 100644
--- a/phpBB/config/development/config.yml
+++ b/phpBB/config/development/config.yml
@@ -6,6 +6,7 @@ core:
debug:
exceptions: true
+ load_time: true
sql_explain: true
twig:
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 6046bf1d71..e352d8ba33 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -4651,7 +4651,7 @@ function phpbb_generate_debug_output(\phpbb\db\driver\driver_interface $db, \php
$debug_info = array();
// Output page creation time
- if (defined('PHPBB_DISPLAY_LOAD_TIME'))
+ if ($phpbb_container->getParameter('debug.load_time'))
{
if (isset($GLOBALS['starttime']))
{
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;
}
diff --git a/phpBB/phpbb/di/extension/container_configuration.php b/phpBB/phpbb/di/extension/container_configuration.php
index 7d1a1abe5e..971b6fb523 100644
--- a/phpBB/phpbb/di/extension/container_configuration.php
+++ b/phpBB/phpbb/di/extension/container_configuration.php
@@ -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()
diff --git a/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php b/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php
index 5bc425b929..47537ba549 100644
--- a/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php
+++ b/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php
@@ -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)
{