mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 18:54:08 +02:00
i am not sure if people will like the config layout i test here... it requires the framework at least being present
git-svn-id: file:///svn/phpbb/trunk@9281 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -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 />";
|
||||
}
|
||||
|
@@ -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,
|
||||
|
@@ -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 ...
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user