lang['UPDATING_TO_LATEST_STABLE']; ?>
-
:: sql_layer; ?>
- ::
+
lang['DATABASE_TYPE']; ?> :: sql_layer; ?>
+ lang['PREVIOUS_VERSION']; ?> ::
finished())
}
catch (phpbb_db_migration_exception $e)
{
- echo $e;
+ echo $e->getLocalisedMessage($user);
phpbb_end_update($cache);
}
@@ -236,8 +234,8 @@ while (!$migrator->finished())
if ((time() - $update_start_time) >= $safe_time_limit)
{
//echo '';
- echo $lang['DATABASE_UPDATE_NOT_COMPLETED'] . '
';
- echo '' . $lang['DATABASE_UPDATE_CONTINUE'] . '';
+ echo $user->lang['DATABASE_UPDATE_NOT_COMPLETED'] . '
';
+ echo '' . $user->lang['DATABASE_UPDATE_CONTINUE'] . '';
phpbb_end_update($cache);
}
@@ -248,6 +246,6 @@ if ($orig_version != $config['version'])
add_log('admin', 'LOG_UPDATE_DATABASE', $orig_version, $config['version']);
}
-echo $lang['DATABASE_UPDATE_COMPLETE'];
+echo $user->lang['DATABASE_UPDATE_COMPLETE'];
phpbb_end_update($cache);
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index a99de9bec9..67649e6b0f 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -1457,12 +1457,12 @@ class install_install extends module
*/
function add_modules($mode, $sub)
{
- global $db, $lang, $phpbb_root_path, $phpEx, $phpbb_extension_manager, $config;
+ global $db, $lang, $phpbb_root_path, $phpEx, $phpbb_extension_manager, $config, $phpbb_container;
// modules require an extension manager
if (empty($phpbb_extension_manager))
{
- $phpbb_extension_manager = new phpbb_extension_manager($db, $config, EXT_TABLE, $phpbb_root_path, ".$phpEx");
+ $phpbb_extension_manager = $phpbb_container->get('ext.manager');
}
include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx);
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 4e4d70ced3..7c1a7d40f5 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -611,6 +611,7 @@ INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id,
# NEW MEMBERS on the queue
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (7, 2, 0, 24, 0);
+
# -- Demo Topic
INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_replies_real, forum_id, topic_status, topic_type, topic_first_post_id, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour, topic_last_post_subject, topic_last_post_time, topic_last_view_time, poll_title) VALUES ('{L_TOPICS_TOPIC_TITLE}', 2, 972086460, 0, 0, 0, 2, 0, 0, 1, 'Admin', 'AA0000', 1, 2, 'Admin', 'AA0000', '{L_TOPICS_TOPIC_TITLE}', 972086460, 972086460, '');
diff --git a/phpBB/language/en/migrator.php b/phpBB/language/en/migrator.php
new file mode 100644
index 0000000000..84074c391c
--- /dev/null
+++ b/phpBB/language/en/migrator.php
@@ -0,0 +1,56 @@
+ 'The config setting "%s" unexpectedly already exists.',
+ 'CONFIG_NOT_EXIST' => 'The config setting "%s" unexpectedly does not exist.',
+
+ 'GROUP_NOT_EXIST' => 'The group "%s" unexpectedly does not exist.',
+
+ 'MIGRATION_EXCEPTION_ERROR' => 'Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors.',
+ 'MIGRATION_NOT_FULFILLABLE' => 'The migration "%1$s" is not fulfillable, missing migration "%2$s".',
+
+ 'MODULE_ALREADY_EXIST' => 'The module "%s" unexpectedly already exists.',
+ 'MODULE_ERROR' => 'An error occured while creating a module: %s',
+ 'MODULE_INFO_FILE_NOT_EXIST' => 'A required module info file is missing: %2$s',
+ 'MODULE_NOT_EXIST' => 'A required module does not exist: %s',
+ 'MODULE_NOT_REMOVABLE' => 'Module %1$s was unable to be removed: %2$s',
+
+ 'PERMISSION_ALREADY_EXIST' => 'The permission setting "%s" unexpectedly already exists.',
+ 'PERMISSION_NOT_EXIST' => 'The permission setting "%s" unexpectedly does not exist.',
+
+ 'ROLE_NOT_EXIST' => 'The permission role "%s" unexpectedly does not exist.',
+));
diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php
index 5cde5bccdb..9032afbd73 100644
--- a/tests/extension/manager_test.php
+++ b/tests/extension/manager_test.php
@@ -25,14 +25,7 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
{
parent::setUp();
- $this->extension_manager = new phpbb_extension_manager(
- $this->new_dbal(),
- new phpbb_config(array()),
- 'phpbb_ext',
- dirname(__FILE__) . '/',
- '.php',
- new phpbb_mock_cache
- );
+ $this->extension_manager = $this->create_extension_manager();
}
public function test_available()
@@ -89,15 +82,30 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
public function test_enabled_no_cache()
{
- $extension_manager = new phpbb_extension_manager(
- $this->new_dbal(),
- new phpbb_config(array()),
- 'phpbb_ext',
- dirname(__FILE__) . '/',
- '.php'
- );
+ $extension_manager = $this->create_extension_manager(false);
$this->assertEquals(array('foo'), array_keys($extension_manager->all_enabled()));
}
+ protected function create_extension_manager($with_cache = true)
+ {
+
+ $config = new phpbb_config(array());
+ $db = $this->new_dbal();
+ $db_tools = new phpbb_db_tools($db);
+ $phpbb_root_path = __DIR__ . './../../phpBB/';
+ $php_ext = 'php';
+ $table_prefix = 'phpbb_';
+
+ return new phpbb_extension_manager(
+ new phpbb_mock_container_builder(),
+ $db,
+ $config,
+ new phpbb_db_migrator($config, $db, $db_tools, 'phpbb_migrations', $phpbb_root_path, $php_ext, $table_prefix, array()),
+ 'phpbb_ext',
+ dirname(__FILE__) . '/',
+ '.' . $php_ext,
+ ($with_cache) ? new phpbb_mock_cache() : null
+ );
+ }
}
diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php
index ce7be0dea5..cdea8d5258 100644
--- a/tests/extension/metadata_manager_test.php
+++ b/tests/extension/metadata_manager_test.php
@@ -34,9 +34,11 @@ class metadata_manager_test extends phpbb_database_test_case
'version' => '3.1.0',
));
$this->db = $this->new_dbal();
+ $this->db_tools = new phpbb_db_tools($this->db);
$this->phpbb_root_path = dirname(__FILE__) . '/';
$this->phpEx = '.php';
$this->user = new phpbb_user();
+ $this->table_prefix = 'phpbb_';
$this->template = new phpbb_template(
$this->phpbb_root_path,
@@ -48,8 +50,10 @@ class metadata_manager_test extends phpbb_database_test_case
);
$this->extension_manager = new phpbb_extension_manager(
+ new phpbb_mock_container_builder(),
$this->db,
$this->config,
+ new phpbb_db_migrator($this->config, $this->db, $this->db_tools, 'phpbb_migrations', $this->phpbb_root_path, $this->php_ext, $this->table_prefix, array()),
'phpbb_ext',
$this->phpbb_root_path,
$this->phpEx,
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index e346223a4b..b570b464e6 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -134,19 +134,20 @@ class phpbb_functional_test_case extends phpbb_test_case
{
global $phpbb_root_path, $phpEx;
- if (!$this->extension_manager)
- {
- $this->extension_manager = new phpbb_extension_manager(
- $this->get_db(),
- new phpbb_config(array()),
- self::$config['table_prefix'] . 'ext',
- $phpbb_root_path,
- ".$phpEx",
- $this->get_cache_driver()
- );
- }
+ $config = new phpbb_config(array());
+ $db = $this->get_db();
+ $db_tools = new phpbb_db_tools($db);
- return $this->extension_manager;
+ return new phpbb_extension_manager(
+ new phpbb_mock_container_builder(),
+ $db,
+ $config,
+ new phpbb_db_migrator($config, $db, $db_tools, self::$config['table_prefix'] . 'migrations', $phpbb_root_path, $php_ext, self::$config['table_prefix'], array()),
+ self::$config['table_prefix'] . 'ext',
+ dirname(__FILE__) . '/',
+ '.' . $php_ext,
+ $this->get_cache_driver()
+ );
}
static protected function install_board()