diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2013-03-05 18:26:01 +0100 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2013-03-05 18:26:01 +0100 |
| commit | 923c0709dbd44f68d76979298cf7d2c732e19494 (patch) | |
| tree | 190c6fbc1dae25a725f504572651f44798e3f6ed /phpBB/install/database_update.php | |
| parent | 6c6912f9e65f0683a806548bdc1a3526ed9ae107 (diff) | |
| parent | 2bf98dcead733a6a2daf9fa0a5d3084ed4ebef5c (diff) | |
| download | forums-923c0709dbd44f68d76979298cf7d2c732e19494.tar forums-923c0709dbd44f68d76979298cf7d2c732e19494.tar.gz forums-923c0709dbd44f68d76979298cf7d2c732e19494.tar.bz2 forums-923c0709dbd44f68d76979298cf7d2c732e19494.tar.xz forums-923c0709dbd44f68d76979298cf7d2c732e19494.zip | |
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into feature/softdelete-1-permission
* 'develop' of https://github.com/phpbb/phpbb3: (234 commits)
[ticket/11398] Correctly call permission_set method in permission tool
[ticket/11394] Relax Migration Tools
[ticket/11386] Fix missing ;
[ticket/10714] Get log from container in install, update and download/file
[feature/avatars] Update module_auth of ucp module and fix small issues
[ticket/11396] Rename insert_migration to set_migration_state
[ticket/11395] Prevent acp_modules::get_modules_info from reincluding files
[ticket/11393] Give more information on database updater
[ticket/11386] Send list of migrations instead of using load_migrations
[feature/avatars] Add migrations data file for avatars
[feature/avatars] Reduce module auth of ucp avatar settings
[ticket/10714] Use $phpbb_adm_relative_path instead of hardcoded adm/
[ticket/10714] Logs are disabled for this page call only
[ticket/10411] Fix call to function on non-object $db->...()
[ticket/10411] Remove ajax delete, so the page is refreshed
[feature/avatars] Auto-clear avatar dimensions when first changing avatars
[ticket/10411] Update schema file with new table and remove the column
[ticket/10411] Add unit tests for move() with values >1
[ticket/10411] Add migrations file for teampage table
[ticket/10411] Revert database_update.php changes from for easier update
...
Diffstat (limited to 'phpBB/install/database_update.php')
| -rw-r--r-- | phpBB/install/database_update.php | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 4938ef0f87..2ecddf49d4 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -123,6 +123,7 @@ $request = $phpbb_container->get('request'); $user = $phpbb_container->get('user'); $auth = $phpbb_container->get('auth'); $db = $phpbb_container->get('dbal.conn'); +$phpbb_log = $phpbb_container->get('log'); // make sure request_var uses this request instance request_var('', 0, false, false, $request); // "dependency injection" for a function @@ -210,7 +211,13 @@ if (!$db_tools->sql_table_exists($table_prefix . 'migrations')) } $migrator = $phpbb_container->get('migrator'); -$migrator->load_migrations($phpbb_root_path . 'includes/db/migration/data/'); +$extension_manager = $phpbb_container->get('ext.manager'); +$finder = $extension_manager->get_finder(); + +$migrations = $finder + ->core_path('includes/db/migration/data/') + ->get_classes(); +$migrator->set_migrations($migrations); // What is a safe limit of execution time? Half the max execution time should be safe. $safe_time_limit = (ini_get('max_execution_time') / 2); @@ -228,7 +235,28 @@ while (!$migrator->finished()) phpbb_end_update($cache); } - echo $migrator->last_run_migration['name'] . '<br />'; + $state = array_merge(array( + 'migration_schema_done' => false, + 'migration_data_done' => false, + ), + $migrator->last_run_migration['state'] + ); + + if (isset($migrator->last_run_migration['effectively_installed']) && $migrator->last_run_migration['effectively_installed']) + { + echo $user->lang('MIGRATION_EFFECTIVELY_INSTALLED', $migrator->last_run_migration['name']) . '<br />'; + } + else + { + if ($state['migration_data_done']) + { + echo $user->lang('MIGRATION_DATA_DONE', $migrator->last_run_migration['name']) . '<br />'; + } + else if ($state['migration_schema_done']) + { + echo $user->lang('MIGRATION_SCHEMA_DONE', $migrator->last_run_migration['name']) . '<br />'; + } + } // Are we approaching the time limit? If so we want to pause the update and continue after refreshing if ((time() - $update_start_time) >= $safe_time_limit) |
