aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/install_install.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/install/install_install.php')
-rw-r--r--phpBB/install/install_install.php25
1 files changed, 21 insertions, 4 deletions
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 009f0dfa33..c749b54f40 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -1151,13 +1151,9 @@ class install_install extends module
// How should we treat this schema?
$delimiter = $available_dbms[$data['dbms']]['DELIM'];
-
$sql_query = @file_get_contents($dbms_schema);
-
$sql_query = preg_replace('#phpbb_#i', $data['table_prefix'], $sql_query);
-
$sql_query = phpbb_remove_comments($sql_query);
-
$sql_query = split_sql_file($sql_query, $delimiter);
foreach ($sql_query as $sql)
@@ -1171,6 +1167,27 @@ class install_install extends module
}
unset($sql_query);
+ // Ok we have the db info go ahead and work on building the table
+ $db_table_schema = @file_get_contents('schemas/schema.json');
+ $db_table_schema = json_decode($db_table_schema, true);
+
+ if (!defined('CONFIG_TABLE'))
+ {
+ // CONFIG_TABLE is required by sql_create_index() to check the
+ // length of index names. However table_prefix is not defined
+ // here yet, so we need to create the constant ourselves.
+ define('CONFIG_TABLE', $data['table_prefix'] . 'config');
+ }
+
+ $db_tools = new \phpbb\db\tools($db);
+ foreach ($db_table_schema as $table_name => $table_data)
+ {
+ $db_tools->sql_create_table(
+ $data['table_prefix'] . substr($table_name, 6),
+ $table_data
+ );
+ }
+
// Ok tables have been built, let's fill in the basic information
$sql_query = file_get_contents('schemas/schema_data.sql');