aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/index.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2011-06-18 01:02:58 +0200
committerNils Adermann <naderman@naderman.de>2011-06-18 01:02:58 +0200
commit1b0821a11baf7e15686dae9c2648878a826be80e (patch)
tree5c4c02156a0365acf1f945e47e1dc8b78cbc4cfc /phpBB/install/index.php
parent2bae5298e01c037fc552da9b5f160821a627a417 (diff)
downloadforums-1b0821a11baf7e15686dae9c2648878a826be80e.tar
forums-1b0821a11baf7e15686dae9c2648878a826be80e.tar.gz
forums-1b0821a11baf7e15686dae9c2648878a826be80e.tar.bz2
forums-1b0821a11baf7e15686dae9c2648878a826be80e.tar.xz
forums-1b0821a11baf7e15686dae9c2648878a826be80e.zip
[ticket/10223] requiring the new startup.php file conditionally.
Added a function for this which we can potentially apply to more of the files in the installer and database updater. PHPBB3-10223
Diffstat (limited to 'phpBB/install/index.php')
-rw-r--r--phpBB/install/index.php24
1 files changed, 19 insertions, 5 deletions
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index ff6a297022..c82c3dbc13 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -24,7 +24,24 @@ if (version_compare(PHP_VERSION, '4.3.3') < 0)
die('You are running an unsupported PHP version. Please upgrade to PHP 4.3.3 or higher before trying to install phpBB 3.0');
}
-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 (file_exists($old_path) || !$optional)
+ {
+ require($old_path);
+ }
+}
+
+phpbb_require_updated('includes/startup.' . $phpEx);
// Try to override some limits - maybe it helps some...
@set_time_limit(0);
@@ -57,10 +74,7 @@ else
// Include essential scripts
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($phpbb_root_path . 'includes/functions_content.' . $phpEx, true);
include($phpbb_root_path . 'includes/auth.' . $phpEx);
include($phpbb_root_path . 'includes/session.' . $phpEx);