aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/database_update.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-07-30 01:38:06 +0200
committerJoas Schilling <nickvergessen@gmx.de>2013-07-30 01:38:06 +0200
commit32499c8808bb72812f66ba00e35c5af128a4d4e2 (patch)
tree1ab6292da09517f86b5c4dfaf31634229a0d533b /phpBB/install/database_update.php
parent0ff2e93c1937f96f8fcd733a152a0c2f263706b1 (diff)
downloadforums-32499c8808bb72812f66ba00e35c5af128a4d4e2.tar
forums-32499c8808bb72812f66ba00e35c5af128a4d4e2.tar.gz
forums-32499c8808bb72812f66ba00e35c5af128a4d4e2.tar.bz2
forums-32499c8808bb72812f66ba00e35c5af128a4d4e2.tar.xz
forums-32499c8808bb72812f66ba00e35c5af128a4d4e2.zip
[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
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r--phpBB/install/database_update.php67
1 files changed, 11 insertions, 56 deletions
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'] . '<br />';
- echo '<a href="' . append_sid($phpbb_root_path . 'install/database_update.' . $phpEx, 'type=' . $request->variable('type', 0) . '&amp;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) . '&amp;language=' . $request->variable('language', 'en')) . '" class="button1">' . $user->lang['DATABASE_UPDATE_CONTINUE'] . '</a>';
phpbb_end_update($cache, $config);
}