diff options
Diffstat (limited to 'phpBB/install/install_install.php')
-rw-r--r-- | phpBB/install/install_install.php | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 20b211dde9..3a6858a254 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1175,8 +1175,31 @@ class install_install extends module } // 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 (file_exists('schemas/schema.json')) + { + $db_table_schema = @file_get_contents('schemas/schema.json'); + $db_table_schema = json_decode($db_table_schema, true); + } + else + { + global $phpbb_root_path, $phpEx, $table_prefix; + $table_prefix = 'phpbb_'; + + if (!defined('CONFIG_TABLE')) + { + // We need to include the constants file for the table constants + // when we generate the schema from the migration files. + include($phpbb_root_path . 'includes/constants.' . $phpEx); + } + + $finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path, null, $phpEx); + $classes = $finder->core_path('phpbb/db/migration/data/') + ->get_classes(); + + $sqlite_db = new \phpbb\db\driver\sqlite(); + $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $sqlite_db, new \phpbb\db\tools($sqlite_db, true), $phpbb_root_path, $phpEx, $table_prefix); + $db_table_schema = $schema_generator->get_schema(); + } if (!defined('CONFIG_TABLE')) { @@ -1654,6 +1677,19 @@ class install_install extends module $db->sql_freeresult($result); $_module->move_module_by($row, 'move_up', 5); + + // Move extension management module 1 up... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_langname = 'ACP_EXTENSION_MANAGEMENT' + AND module_class = 'acp' + AND module_mode = '' + AND module_basename = ''"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_up', 1); } if ($module_class == 'mcp') @@ -1926,7 +1962,7 @@ class install_install extends module 'bot_ip' => (string) $bot_ary[1], )); - $result = $db->sql_query($sql); + $db->sql_query($sql); } } @@ -2047,7 +2083,7 @@ class install_install extends module return array( 'language' => basename(request_var('language', '')), 'dbms' => request_var('dbms', ''), - 'dbhost' => request_var('dbhost', ''), + 'dbhost' => request_var('dbhost', '', true), 'dbport' => request_var('dbport', ''), 'dbuser' => request_var('dbuser', ''), 'dbpasswd' => request_var('dbpasswd', '', true), |