aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/common.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-04-28 12:49:44 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-04-28 12:49:44 +0000
commit34fcc7dbe12b823667edfe5a35b0d2dfcea2af37 (patch)
tree4095518177ecb7b75a38d09e2d8c9eed49232fa7 /phpBB/common.php
parent1b065fb74afedf2513d5dab4726516f8778cdf9d (diff)
downloadforums-34fcc7dbe12b823667edfe5a35b0d2dfcea2af37.tar
forums-34fcc7dbe12b823667edfe5a35b0d2dfcea2af37.tar.gz
forums-34fcc7dbe12b823667edfe5a35b0d2dfcea2af37.tar.bz2
forums-34fcc7dbe12b823667edfe5a35b0d2dfcea2af37.tar.xz
forums-34fcc7dbe12b823667edfe5a35b0d2dfcea2af37.zip
graham, sorry for this but i had to... ;)
- utilize common.php in installer (we only need to change one location then) - use $user->lang instead of $lang to be able to use language template vars and having consistant namings git-svn-id: file:///svn/phpbb/trunk@5855 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/common.php')
-rw-r--r--phpBB/common.php83
1 files changed, 48 insertions, 35 deletions
diff --git a/phpBB/common.php b/phpBB/common.php
index 6d3efc681c..b037d87ea9 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -23,8 +23,8 @@ if (!defined('IN_PHPBB'))
$starttime = explode(' ', microtime());
$starttime = $starttime[1] + $starttime[0];
-error_reporting(E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
-//error_reporting(E_ALL);
+//error_reporting(E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables
+error_reporting(E_ALL);
/**
* Remove variables created by register_globals from the global scope
@@ -80,7 +80,7 @@ function deregister_globals()
}
// If we are on PHP >= 6.0.0 we do not need some code
-if (version_compare(phpversion(), '6.0.0', '>='))
+if (version_compare(phpversion(), '6.0.0-dev', '>='))
{
define('STRIP', false);
}
@@ -103,38 +103,45 @@ if (defined('IN_CRON'))
$phpbb_root_path = getcwd() . '/';
}
-require($phpbb_root_path . 'config.'.$phpEx);
-
-if (!defined('PHPBB_INSTALLED'))
+// Run the following code if not currently installing
+if (!defined('IN_INSTALL'))
{
- header('Location: install/index.'.$phpEx);
- exit;
-}
+ require($phpbb_root_path . 'config.'.$phpEx);
-if (defined('DEBUG_EXTRA'))
-{
- $base_memory_usage = 0;
- if (function_exists('memory_get_usage'))
+ if (!defined('PHPBB_INSTALLED'))
{
- $base_memory_usage = memory_get_usage();
+ header('Location: install/index.'.$phpEx);
+ exit;
}
-}
-// Load Extensions
-if (!empty($load_extensions))
-{
- $load_extensions = explode(',', $load_extensions);
+ if (defined('DEBUG_EXTRA'))
+ {
+ $base_memory_usage = 0;
+ if (function_exists('memory_get_usage'))
+ {
+ $base_memory_usage = memory_get_usage();
+ }
+ }
- foreach ($load_extensions as $extension)
+ // Load Extensions
+ if (!empty($load_extensions))
{
- @dl(trim($extension));
+ $load_extensions = explode(',', $load_extensions);
+
+ foreach ($load_extensions as $extension)
+ {
+ @dl(trim($extension));
+ }
}
}
+else
+{
+ $acm_type = 'file';
+}
// Include files
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
require($phpbb_root_path . 'includes/acm/acm_main.' . $phpEx);
-require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/template.' . $phpEx);
require($phpbb_root_path . 'includes/session.' . $phpEx);
require($phpbb_root_path . 'includes/auth.' . $phpEx);
@@ -149,22 +156,28 @@ $user = new user();
$auth = new auth();
$template = new template();
$cache = new cache();
-$db = new $sql_db();
-// Connect to DB
-$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
+// Initiate DBAL if not installing
+if (!defined('IN_INSTALL'))
+{
+ require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
+ $db = new $sql_db();
-// We do not need this any longer, unset for safety purposes
-unset($dbpasswd);
+ // Connect to DB
+ $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
-// Grab global variables, re-cache if necessary
-$config = $cache->obtain_config();
-$dss_seeded = false;
+ // We do not need this any longer, unset for safety purposes
+ unset($dbpasswd);
-// Warn about install/ directory
-if (file_exists('install'))
-{
-// trigger_error('REMOVE_INSTALL');
+ // Grab global variables, re-cache if necessary
+ $config = $cache->obtain_config();
+ $dss_seeded = false;
+
+ // Warn about install/ directory
+ if (file_exists('install'))
+ {
+ // trigger_error('REMOVE_INSTALL');
+ }
}
-?>
+?> \ No newline at end of file