From 32499c8808bb72812f66ba00e35c5af128a4d4e2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 30 Jul 2013 01:38:06 +0200 Subject: [ticket/11574] Remove install/udpate/new/ fallback from database_update.php Since we switched the order, everything should be in the normal root by then. PHPBB3-11574 --- phpBB/install/database_update.php | 67 +++++++-------------------------------- phpBB/language/en/install.php | 2 +- 2 files changed, 12 insertions(+), 57 deletions(-) (limited to 'phpBB') diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index f69f0f6986..3be5ea659c 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -21,46 +21,6 @@ define('IN_INSTALL', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); -if (!function_exists('phpbb_require_updated')) -{ - function phpbb_require_updated($path, $optional = false) - { - global $phpbb_root_path, $table_prefix; - - $new_path = $phpbb_root_path . 'install/update/new/' . $path; - $old_path = $phpbb_root_path . $path; - - if (file_exists($new_path)) - { - require($new_path); - } - else if (!$optional || file_exists($old_path)) - { - require($old_path); - } - } -} - -if (!function_exists('phpbb_include_updated')) -{ - function phpbb_include_updated($path, $optional = false) - { - global $phpbb_root_path; - - $new_path = $phpbb_root_path . 'install/update/new/' . $path; - $old_path = $phpbb_root_path . $path; - - if (file_exists($new_path)) - { - include($new_path); - } - else if (!$optional || file_exists($old_path)) - { - include($old_path); - } - } -} - function phpbb_end_update($cache, $config) { $cache->purge(); @@ -89,7 +49,7 @@ function phpbb_end_update($cache, $config) exit_handler(); } -phpbb_require_updated('includes/startup.' . $phpEx); +require($phpbb_root_path . 'includes/startup.' . $phpEx); include($phpbb_root_path . 'config.' . $phpEx); if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type)) @@ -102,33 +62,28 @@ $phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relati $phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path; // Include files -phpbb_require_updated('phpbb/class_loader.' . $phpEx); +require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx); -phpbb_require_updated('includes/functions.' . $phpEx); -phpbb_require_updated('includes/functions_content.' . $phpEx); -phpbb_require_updated('includes/functions_container.' . $phpEx); +require($phpbb_root_path . 'includes/functions.' . $phpEx); +require($phpbb_root_path . 'includes/functions_content.' . $phpEx); +require($phpbb_root_path . 'includes/functions_container.' . $phpEx); require($phpbb_root_path . 'config.' . $phpEx); -phpbb_require_updated('includes/constants.' . $phpEx); -phpbb_include_updated('includes/utf/utf_normalizer.' . $phpEx); -phpbb_require_updated('includes/utf/utf_tools.' . $phpEx); +require($phpbb_root_path . 'includes/constants.' . $phpEx); +include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx); +require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); // Set PHP error handler to ours set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); // Setup class loader first -$phpbb_class_loader_new = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}install/update/new/phpbb/", $phpEx); -$phpbb_class_loader_new->register(); $phpbb_class_loader = new phpbb_class_loader('phpbb_', "{$phpbb_root_path}phpbb/", $phpEx); $phpbb_class_loader->register(); // Set up container (must be done here because extensions table may not exist) -$other_config_path = $phpbb_root_path . 'install/update/new/config/'; -$config_path = file_exists($other_config_path . 'services.yml') ? $other_config_path : $phpbb_root_path . 'config/'; - $container_extensions = array( new phpbb_di_extension_config($phpbb_root_path . 'config.' . $phpEx), - new phpbb_di_extension_core($config_path), + new phpbb_di_extension_core($phpbb_root_path . 'config/'), ); $container_passes = array( new phpbb_di_pass_collection_pass(), @@ -289,8 +244,8 @@ while (!$migrator->finished()) // 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) { - echo $user->lang['DATABASE_UPDATE_NOT_COMPLETED'] . '
'; - echo '' . $user->lang['DATABASE_UPDATE_CONTINUE'] . ''; + echo '
' . $user->lang['DATABASE_UPDATE_NOT_COMPLETED'] . '

'; + echo '' . $user->lang['DATABASE_UPDATE_CONTINUE'] . ''; phpbb_end_update($cache, $config); } diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index f994f339a9..03c9562983 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -398,7 +398,7 @@ $lang = array_merge($lang, array( 'DATABASE_TYPE' => 'Database type', 'DATABASE_UPDATE_COMPLETE' => 'Database updater has completed!', - 'DATABASE_UPDATE_CONTINUE' => 'Continue database update.', + 'DATABASE_UPDATE_CONTINUE' => 'Continue database update', 'DATABASE_UPDATE_INFO_OLD' => 'The database update file within the install directory is outdated. Please make sure you uploaded the correct version of the file.', 'DATABASE_UPDATE_NOT_COMPLETED' => 'The database update has not yet completed.', 'DELETE_USER_REMOVE' => 'Delete user and remove posts', -- cgit v1.2.1