aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/database_update.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2011-06-19 17:57:42 +0200
committerAndreas Fischer <bantu@phpbb.com>2011-06-19 17:57:42 +0200
commit93dba4b02398a2bafec13348117b370859951fb6 (patch)
treeb40a0e1d0a1ae542b182c42876735f0b7fb3c3a0 /phpBB/install/database_update.php
parent540545c4bd57cd61dd84acf33fb2403b496b7965 (diff)
parent4e85731a5f7bd336f23b463b69b7cc8953225046 (diff)
downloadforums-93dba4b02398a2bafec13348117b370859951fb6.tar
forums-93dba4b02398a2bafec13348117b370859951fb6.tar.gz
forums-93dba4b02398a2bafec13348117b370859951fb6.tar.bz2
forums-93dba4b02398a2bafec13348117b370859951fb6.tar.xz
forums-93dba4b02398a2bafec13348117b370859951fb6.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/10223] The search fid parameter is an array of forums not just an id [ticket/10223] Check optional before file_exists and correct require path [ticket/10223] requiring the new startup.php file conditionally.
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r--phpBB/install/database_update.php24
1 files changed, 19 insertions, 5 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index b4166186d3..e2f5b76fed 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -33,7 +33,24 @@ define('IN_INSTALL', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
-require($phpbb_root_path . 'includes/startup.' . $phpEx);
+function phpbb_require_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))
+ {
+ require($new_path);
+ }
+ else if (!$optional || file_exists($old_path))
+ {
+ require($old_path);
+ }
+}
+
+phpbb_require_updated('includes/startup.' . $phpEx);
$updates_to_version = UPDATES_TO_VERSION;
$debug_from_version = DEBUG_FROM_VERSION;
@@ -70,10 +87,7 @@ require($phpbb_root_path . 'includes/auth.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
-if (file_exists($phpbb_root_path . 'includes/functions_content.' . $phpEx))
-{
- require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
-}
+phpbb_require_updated('includes/functions_content.' . $phpEx, true);
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);