diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2008-12-28 23:30:09 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2008-12-28 23:30:09 +0000 |
| commit | 19aed179e53f9660a7202e2e50816e1cef0f7be9 (patch) | |
| tree | e2707fd68720f206c88f8bcaff6e2fc3173c9c94 /phpBB/install | |
| parent | 4ded6cf5eef0892f9ef1d7351664e1d78445c419 (diff) | |
| download | forums-19aed179e53f9660a7202e2e50816e1cef0f7be9.tar forums-19aed179e53f9660a7202e2e50816e1cef0f7be9.tar.gz forums-19aed179e53f9660a7202e2e50816e1cef0f7be9.tar.bz2 forums-19aed179e53f9660a7202e2e50816e1cef0f7be9.tar.xz forums-19aed179e53f9660a7202e2e50816e1cef0f7be9.zip | |
$config to phpbb::$config
git-svn-id: file:///svn/phpbb/trunk@9242 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install')
| -rw-r--r-- | phpBB/install/database_update.php | 20 | ||||
| -rw-r--r-- | phpBB/install/index.php | 6 | ||||
| -rw-r--r-- | phpBB/install/install_install.php | 32 | ||||
| -rw-r--r-- | phpBB/install/install_update.php | 26 |
4 files changed, 24 insertions, 60 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 996deb0339..67794221a6 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -371,23 +371,15 @@ header('Content-type: text/html; charset=UTF-8'); <?php // To let set_config() calls succeed, we need to make the config array available globally -$config = array(); -$sql = 'SELECT * - FROM ' . CONFIG_TABLE; -$result = $db->sql_query($sql); - -while ($row = $db->sql_fetchrow($result)) -{ - $config[$row['config_name']] = $row['config_value']; -} -$db->sql_freeresult($result); +phpbb::$acm->destroy('#config'); +$config = phpbb_cache::obtain_config(); -echo $lang['PREVIOUS_VERSION'] . ' :: <strong>' . $config['version'] . '</strong><br />'; +echo $lang['PREVIOUS_VERSION'] . ' :: <strong>' . phpbb::$config['version'] . '</strong><br />'; echo $lang['UPDATED_VERSION'] . ' :: <strong>' . $updates_to_version . '</strong></p>'; -$current_version = str_replace('rc', 'RC', strtolower($config['version'])); +$current_version = str_replace('rc', 'RC', strtolower(phpbb::$config['version'])); $latest_version = str_replace('rc', 'RC', strtolower($updates_to_version)); -$orig_version = $config['version']; +$orig_version = phpbb::$config['version']; // If the latest version and the current version are 'unequal', we will update the version_update_from, else we do not update anything. if ($inline_update) @@ -708,7 +700,7 @@ if (function_exists('exit_handler')) */ function change_database_data($version) { - global $db, $map_dbms, $errored, $error_ary, $config; + global $db, $map_dbms, $errored, $error_ary; switch ($version) { diff --git a/phpBB/install/index.php b/phpBB/install/index.php index ac8796feb2..407ccec4db 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -243,9 +243,7 @@ $auth = new auth(); $template = new template(); // Set some standard variables we want to force -$config = array( - 'load_tplcompile' => '1' -); +phpbb::$config['load_tplcompile'] = '1'; $template->set_custom_template('../adm/style', 'admin'); $template->assign_var('T_TEMPLATE_PATH', '../adm/style'); @@ -284,7 +282,7 @@ class module */ function create($module_type, $module_url, $selected_mod = false, $selected_submod = false) { - global $db, $config; + global $db; $module = array(); diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 7e93f008f6..d38b833204 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1438,7 +1438,7 @@ class install_install extends module */ function build_search_index($mode, $sub) { - global $db, $lang, $config; + global $db, $lang; // Obtain any submitted data $data = $this->get_submitted_data(); @@ -1468,7 +1468,7 @@ class install_install extends module include_once(PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT); include_once(PHPBB_ROOT_PATH . 'includes/search/fulltext_native.' . PHP_EXT); - // Fill the config array - it is needed by those functions we call + /* Fill the config array - it is needed by those functions we call $sql = 'SELECT * FROM ' . CONFIG_TABLE; $result = $db->sql_query($sql); @@ -1479,7 +1479,7 @@ class install_install extends module $config[$row['config_name']] = $row['config_value']; } $db->sql_freeresult($result); - +*/ $error = false; $search = new fulltext_native($error); @@ -1833,7 +1833,7 @@ class install_install extends module */ function add_bots($mode, $sub) { - global $db, $lang, $config; + global $db, $lang; // Obtain any submitted data $data = $this->get_submitted_data(); @@ -1843,13 +1843,6 @@ class install_install extends module FROM ' . CONFIG_TABLE; $result = $db->sql_query($sql); - $config = array(); - while ($row = $db->sql_fetchrow($result)) - { - $config[$row['config_name']] = $row['config_value']; - } - $db->sql_freeresult($result); - $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " WHERE group_name_clean = 'bots'"; @@ -1911,7 +1904,7 @@ class install_install extends module */ function email_admin($mode, $sub) { - global $auth, $config, $db, $lang, $template, $user; + global $auth, $db, $lang, $template, $user; $this->page_title = $lang['STAGE_FINAL']; @@ -1922,13 +1915,6 @@ class install_install extends module FROM ' . CONFIG_TABLE; $result = $db->sql_query($sql); - $config = array(); - while ($row = $db->sql_fetchrow($result)) - { - $config[$row['config_name']] = $row['config_value']; - } - $db->sql_freeresult($result); - $user->session_begin(); $auth->login($data['admin_name'], $data['admin_pass1'], false, true, true); @@ -1937,7 +1923,7 @@ class install_install extends module // So it's time to send an email to the administrator confirming the details // they entered - if ($config['email_enable']) + if (phpbb::$config['email_enable']) { include_once(PHPBB_ROOT_PATH . 'includes/functions_messenger.' . PHP_EXT); @@ -1947,7 +1933,7 @@ class install_install extends module $messenger->to($data['board_email1'], $data['admin_name']); - $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); + $messenger->headers('X-AntiAbuse: Board servername - ' . phpbb::$config['server_name']); $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']); $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']); $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); @@ -1961,11 +1947,11 @@ class install_install extends module } // And finally, add a note to the log - add_log('admin', 'LOG_INSTALL_INSTALLED', $config['version']); + add_log('admin', 'LOG_INSTALL_INSTALLED', phpbb::$config['version']); $template->assign_vars(array( 'TITLE' => $lang['INSTALL_CONGRATS'], - 'BODY' => sprintf($lang['INSTALL_CONGRATS_EXPLAIN'], $config['version'], append_sid('install/index', 'mode=convert&language=' . $data['language']), '../docs/README.html'), + 'BODY' => sprintf($lang['INSTALL_CONGRATS_EXPLAIN'], phpbb::$config['version'], append_sid('install/index', 'mode=convert&language=' . $data['language']), '../docs/README.html'), 'L_SUBMIT' => $lang['INSTALL_LOGIN'], 'U_ACTION' => append_sid('adm/index'), )); diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index a396c04dc5..4da795bb4b 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -70,7 +70,7 @@ class install_update extends module function main($mode, $sub) { - global $template, $user, $db, $config, $auth; + global $template, $user, $db, $auth; $this->tpl_name = 'install_update'; $this->page_title = 'UPDATE_INSTALLATION'; @@ -98,20 +98,8 @@ class install_update extends module // We do not need this any longer, unset for safety purposes unset($dbpasswd); - $config = array(); - - $sql = 'SELECT config_name, config_value - FROM ' . CONFIG_TABLE; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $config[$row['config_name']] = $row['config_value']; - } - $db->sql_freeresult($result); - // Force template recompile - $config['load_tplcompile'] = 1; + phpbb::$config['load_tplcompile'] = 1; // First of all, init the user session $user->session_begin(); @@ -140,7 +128,7 @@ class install_update extends module } // For the current version we trick a bit. ;) - $this->current_version = (!empty($config['version_update_from'])) ? $config['version_update_from'] : $config['version']; + $this->current_version = (!empty(phpbb::$config['version_update_from'])) ? phpbb::$config['version_update_from'] : phpbb::$config['version']; $up_to_date = (version_compare(str_replace('rc', 'RC', strtolower($this->current_version)), str_replace('rc', 'RC', strtolower($this->latest_version)), '<')) ? false : true; @@ -149,7 +137,7 @@ class install_update extends module { $template->assign_vars(array( 'S_ERROR' => true, - 'ERROR_MSG' => ($up_to_date) ? $user->lang['NO_UPDATE_FILES_UP_TO_DATE'] : sprintf($user->lang['NO_UPDATE_FILES_OUTDATED'], $config['version'], $this->current_version, $this->latest_version)) + 'ERROR_MSG' => ($up_to_date) ? $user->lang['NO_UPDATE_FILES_UP_TO_DATE'] : sprintf($user->lang['NO_UPDATE_FILES_OUTDATED'], phpbb::$config['version'], $this->current_version, $this->latest_version)) ); return; @@ -163,7 +151,7 @@ class install_update extends module { $template->assign_vars(array( 'S_ERROR' => true, - 'ERROR_MSG' => sprintf($user->lang['INCOMPATIBLE_UPDATE_FILES'], $config['version'], $this->update_info['version']['from'], $this->update_info['version']['to'])) + 'ERROR_MSG' => sprintf($user->lang['INCOMPATIBLE_UPDATE_FILES'], phpbb::$config['version'], $this->update_info['version']['from'], $this->update_info['version']['to'])) ); return; @@ -278,7 +266,7 @@ class install_update extends module // Redirect the user to the database update script with some explanations... $template->assign_vars(array( 'S_DB_UPDATE' => true, - 'S_DB_UPDATE_FINISHED' => ($config['version'] == $this->update_info['version']['to']) ? true : false, + 'S_DB_UPDATE_FINISHED' => (phpbb::$config['version'] == $this->update_info['version']['to']) ? true : false, 'U_DB_UPDATE' => append_sid('install/database_update', 'type=1&language=' . $user->data['user_lang']), 'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_db"), 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"), @@ -785,7 +773,7 @@ class install_update extends module // To ease the update process create a file location map $update_list = phpbb::$acm->get('update_list'); - $script_path = ($config['force_server_vars']) ? (($config['script_path'] == '/') ? '/' : $config['script_path'] . '/') : $user->page['root_script_path']; + $script_path = (phpbb::$config['force_server_vars']) ? ((phpbb::$config['script_path'] == '/') ? '/' : phpbb::$config['script_path'] . '/') : $user->page['root_script_path']; foreach ($update_list as $status => $files) { |
