mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-05 23:25:30 +02:00
[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
This commit is contained in:
parent
0ff2e93c19
commit
32499c8808
@ -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'] . '<br />';
|
||||
echo '<a href="' . append_sid($phpbb_root_path . 'install/database_update.' . $phpEx, 'type=' . $request->variable('type', 0) . '&language=' . $request->variable('language', 'en')) . '">' . $user->lang['DATABASE_UPDATE_CONTINUE'] . '</a>';
|
||||
echo '<br />' . $user->lang['DATABASE_UPDATE_NOT_COMPLETED'] . '<br /><br />';
|
||||
echo '<a href="' . append_sid($phpbb_root_path . 'install/database_update.' . $phpEx, 'type=' . $request->variable('type', 0) . '&language=' . $request->variable('language', 'en')) . '" class="button1">' . $user->lang['DATABASE_UPDATE_CONTINUE'] . '</a>';
|
||||
|
||||
phpbb_end_update($cache, $config);
|
||||
}
|
||||
|
@ -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',
|
||||
|
Loading…
x
Reference in New Issue
Block a user