aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/install')
-rw-r--r--phpBB/install/database_update.php2
-rw-r--r--phpBB/install/index.php68
-rw-r--r--phpBB/install/install_install.php16
-rw-r--r--phpBB/install/install_update.php2
4 files changed, 9 insertions, 79 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 0b495cf995..f72f963bff 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -337,7 +337,7 @@ function change_database_data($version)
*/
function _sql($sql, &$errored, &$error_ary, $echo_dot = true)
{
- if (defined('DEBUG_EXTRA'))
+ if (phpbb::$base_config['debug_extra'])
{
echo "<br />\n{$sql}\n<br />";
}
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index b09330f88b..bb22ebaf36 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -56,74 +56,6 @@ else
@ini_set('memory_limit', $mem_limit);
*/
-/* Try and load an appropriate language if required
-$language = basename(request_var('language', ''));
-
-if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language)
-{
- $accept_lang_ary = explode(',', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
- foreach ($accept_lang_ary as $accept_lang)
- {
- // Set correct format ... guess full xx_yy form
- $accept_lang = substr($accept_lang, 0, 2) . '_' . substr($accept_lang, 3, 2);
-
- if (file_exists(PHPBB_ROOT_PATH . 'language/' . $accept_lang))
- {
- $language = $accept_lang;
- break;
- }
- else
- {
- // No match on xx_yy so try xx
- $accept_lang = substr($accept_lang, 0, 2);
- if (file_exists(PHPBB_ROOT_PATH . 'language/' . $accept_lang))
- {
- $language = $accept_lang;
- break;
- }
- }
- }
-}
-
-// No appropriate language found ... so let's use the first one in the language
-// dir, this may or may not be English
-if (!$language)
-{
- $dir = @opendir(PHPBB_ROOT_PATH . 'language');
-
- if (!$dir)
- {
- die('Unable to access the language directory');
- exit;
- }
-
- while (($file = readdir($dir)) !== false)
- {
- $path = PHPBB_ROOT_PATH . 'language/' . $file;
-
- if (!is_file($path) && !is_link($path) && file_exists($path . '/iso.txt'))
- {
- $language = $file;
- break;
- }
- }
- closedir($dir);
-}
-
-if (!file_exists(PHPBB_ROOT_PATH . 'language/' . $language))
-{
- die('No language found!');
-}
-
-// And finally, load the relevant language files
-include(PHPBB_ROOT_PATH . 'language/' . $language . '/common.' . PHP_EXT);
-include(PHPBB_ROOT_PATH . 'language/' . $language . '/acp/common.' . PHP_EXT);
-include(PHPBB_ROOT_PATH . 'language/' . $language . '/acp/board.' . PHP_EXT);
-include(PHPBB_ROOT_PATH . 'language/' . $language . '/install.' . PHP_EXT);
-include(PHPBB_ROOT_PATH . 'language/' . $language . '/posting.' . PHP_EXT);
-
-*/
-
// Initialize some common config variables
phpbb::$config += array(
'load_tplcompile' => true,
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 46618d7eb0..001acc4584 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -21,9 +21,9 @@ if (!empty($setmodules))
// If phpBB is already installed we do not include this module
if (@file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) && !file_exists(PHPBB_ROOT_PATH . 'cache/install_lock'))
{
- include_once(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
+ include PHPBB_ROOT_PATH . 'config.' . PHP_EXT;
- if (defined('PHPBB_INSTALLED'))
+ if (phpbb::$base_config['installed'])
{
return;
}
@@ -800,6 +800,7 @@ class install_install extends module
// Time to convert the data provided into a config file
$config_data = "<?php\n";
$config_data .= "// phpBB 3.0.x auto-generated configuration file\n// Do not change anything in this file!\n";
+ $config_data .= "if (class_exists('phpbb') && defined('IN_PHPBB'))\n{\n\tphpbb::set_config(array(\n";
$config_data_array = array(
'dbms' => $available_dbms[$data['dbms']]['DRIVER'],
@@ -809,21 +810,18 @@ class install_install extends module
'dbuser' => $data['dbuser'],
'dbpasswd' => htmlspecialchars_decode($data['dbpasswd']),
'table_prefix' => $data['table_prefix'],
+ 'admin_folder' => 'adm',
'acm_type' => 'file',
- 'load_extensions' => $load_extensions,
+ 'extensions' => $load_extensions,
);
foreach ($config_data_array as $key => $value)
{
- $config_data .= "\${$key} = '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $value)) . "';\n";
+ $config_data .= "\t\t'{$key}' => '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $value)) . "',\n";
}
unset($config_data_array);
- $config_data .= "\n// If you rename your admin folder, please change this value\n";
- $config_data .= "@define('CONFIG_ADM_FOLDER', 'adm');\n";
- $config_data .= "@define('PHPBB_INSTALLED', true);\n";
- $config_data .= "@define('DEBUG', true);\n";
- $config_data .= "@define('DEBUG_EXTRA', true);\n";
+ $config_data .= "\n\t\t'debug' => true,\n\t\t'debug_extra' => true,\n\n\t\t// DO NOT CHANGE\n\t\t'installed' => true,\n\t));\n}\n";
$config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused!
// Attempt to write out the config file directly. If it works, this is the easiest way to do it ...
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index d347c0af59..137b9d4957 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -24,7 +24,7 @@ if (!empty($setmodules))
{
include_once(PHPBB_ROOT_PATH . 'config.' . PHP_EXT);
- if (!defined('PHPBB_INSTALLED'))
+ if (!phpbb::$base_config['installed'])
{
return;
}