aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_install.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions_install.php')
-rw-r--r--phpBB/includes/functions_install.php31
1 files changed, 13 insertions, 18 deletions
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php
index 28cc603bdb..d9d073e984 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -182,18 +182,6 @@ function dbms_select($default = '', $only_20x_options = false)
}
/**
-* Get tables of a database
-*
-* @deprecated
-*/
-function get_tables(&$db)
-{
- $db_tools = new \phpbb\db\tools($db);
-
- return $db_tools->sql_list_tables();
-}
-
-/**
* Used to test whether we are able to connect to the database the user has specified
* and identify any problems (eg there are already tables with the names we want to use
* @param array $dbms should be of the format of an element of the array returned by {@link get_available_dbms get_available_dbms()}
@@ -201,7 +189,7 @@ function get_tables(&$db)
*/
function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix, $dbhost, $dbuser, $dbpasswd, $dbname, $dbport, $prefix_may_exist = false, $load_dbal = true, $unicode_check = true)
{
- global $phpbb_root_path, $phpEx, $config, $lang;
+ global $phpbb_root_path, $phpEx, $config, $lang, $phpbb_filesystem;
$dbms = $dbms_details['DRIVER'];
@@ -217,7 +205,7 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
}
// Make sure we don't have a daft user who thinks having the SQLite database in the forum directory is a good idea
- if (($dbms_details['DRIVER'] == 'phpbb\db\driver\sqlite' || $dbms_details['DRIVER'] == 'phpbb\db\driver\sqlite3') && stripos(phpbb_realpath($dbhost), phpbb_realpath('../')) === 0)
+ if (($dbms_details['DRIVER'] == 'phpbb\db\driver\sqlite' || $dbms_details['DRIVER'] == 'phpbb\db\driver\sqlite3') && stripos($phpbb_filesystem->realpath($dbhost), $phpbb_filesystem->realpath('../')) === 0)
{
$error[] = $lang['INST_ERR_DB_FORUM_PATH'];
return false;
@@ -276,7 +264,9 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
$temp_prefix = strtolower($table_prefix);
$table_ary = array($temp_prefix . 'attachments', $temp_prefix . 'config', $temp_prefix . 'sessions', $temp_prefix . 'topics', $temp_prefix . 'users');
- $tables = get_tables($db);
+ $db_tools_factory = new \phpbb\db\tools\factory();
+ $db_tools = $db_tools_factory->get($db);
+ $tables = $db_tools->sql_list_tables();
$tables = array_map('strtolower', $tables);
$table_intersect = array_intersect($tables, $table_ary);
@@ -451,13 +441,17 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_cont
$config_data .= "\n@define('PHPBB_INSTALLED', true);\n";
$config_data .= "// @define('PHPBB_DISPLAY_LOAD_TIME', true);\n";
- if ($debug)
+ if ($debug_test)
+ {
+ $config_data .= "@define('PHPBB_ENVIRONMENT', 'test');\n";
+ }
+ else if ($debug)
{
- $config_data .= "@define('DEBUG', true);\n";
+ $config_data .= "@define('PHPBB_ENVIRONMENT', 'development');\n";
}
else
{
- $config_data .= "// @define('DEBUG', true);\n";
+ $config_data .= "@define('PHPBB_ENVIRONMENT', 'production');\n";
}
if ($debug_container)
@@ -472,6 +466,7 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_cont
if ($debug_test)
{
$config_data .= "@define('DEBUG_TEST', true);\n";
+ $config_data .= "@define('DEBUG', true);\n"; // Mandatory for the functional tests, will be removed by PHPBB3-12623
}
return $config_data;