diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2008-12-28 13:27:58 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2008-12-28 13:27:58 +0000 |
| commit | 889fa871402814874d5d4f01b2f1c829d8206eb9 (patch) | |
| tree | ce3d6b9c23a6df118c1458cc7adeafa10ffde5a8 /phpBB/install | |
| parent | fbaf2baa8d683a2afdd3cf98ea1e7c035369f1a3 (diff) | |
| download | forums-889fa871402814874d5d4f01b2f1c829d8206eb9.tar forums-889fa871402814874d5d4f01b2f1c829d8206eb9.tar.gz forums-889fa871402814874d5d4f01b2f1c829d8206eb9.tar.bz2 forums-889fa871402814874d5d4f01b2f1c829d8206eb9.tar.xz forums-889fa871402814874d5d4f01b2f1c829d8206eb9.zip | |
implement new phpbb::$acm object, replacing $cache global
git-svn-id: file:///svn/phpbb/trunk@9240 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install')
| -rw-r--r-- | phpBB/install/convertors/functions_phpbb20.php | 30 | ||||
| -rw-r--r-- | phpBB/install/database_update.php | 5 | ||||
| -rw-r--r-- | phpBB/install/index.php | 1 | ||||
| -rw-r--r-- | phpBB/install/install_convert.php | 18 | ||||
| -rw-r--r-- | phpBB/install/install_update.php | 48 |
5 files changed, 50 insertions, 52 deletions
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 8b15c81ca8..a9710031f8 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -71,8 +71,8 @@ function phpbb_insert_forums() $result = $src_db->sql_query($sql); $prune_enabled = (int) $src_db->sql_fetchfield('config_value'); $src_db->sql_freeresult($result); - - + + // Insert categories $sql = 'SELECT cat_id, cat_title FROM ' . $convert->src_table_prefix . 'categories @@ -543,7 +543,7 @@ function phpbb_copy_table_fields() */ function phpbb_convert_authentication($mode) { - global $db, $src_db, $same_db, $convert, $user, $config, $cache; + global $db, $src_db, $same_db, $convert, $user, $config; if ($mode == 'start') { @@ -968,12 +968,12 @@ function phpbb_convert_authentication($mode) { // And now the moderators // We make sure that they have at least standard access to the forums they moderate in addition to the moderating permissions - + $mod_post_map = array( 'auth_announce' => 'f_announce', 'auth_sticky' => 'f_sticky' ); - + foreach ($user_access as $forum_id => $access_map) { $forum_id = (int) $forum_id; @@ -1223,7 +1223,7 @@ function phpbb_replace_size($matches) */ function phpbb_prepare_message($message) { - global $db, $convert, $user, $config, $cache, $convert_row, $message_parser; + global $db, $convert, $user, $config, $convert_row, $message_parser; if (!$message) { @@ -1247,7 +1247,7 @@ function phpbb_prepare_message($message) { $message = preg_replace('/\[quote="(.*?)"\]/s', '[quote="\1"]', $message); $message = preg_replace('/\[quote=\\\"(.*?)\\\"\]/s', '[quote="\1"]', $message); - + // let's hope that this solves more problems than it causes. Deal with escaped quotes. $message = str_replace('\"', '"', $message); $message = str_replace('\"', '"', $message); @@ -1276,7 +1276,7 @@ function phpbb_prepare_message($message) // parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $update_this_message = true, $mode = 'post') $message_parser->parse($enable_bbcode, $enable_magic_url, $enable_smilies); - + if (sizeof($message_parser->warn_msg)) { $msg_id = isset($convert->row['post_id']) ? $convert->row['post_id'] : $convert->row['privmsgs_id']; @@ -1328,7 +1328,7 @@ function phpbb_get_files_dir() return; } - global $src_db, $same_db, $convert, $user, $config, $cache; + global $src_db, $same_db, $convert, $user, $config; if ($convert->mysql_convert && $same_db) { @@ -1367,10 +1367,10 @@ function phpbb_get_files_dir() */ function phpbb_copy_thumbnails() { - global $db, $convert, $user, $config, $cache; + global $db, $convert, $user, $config; $src_path = $convert->options['forum_path'] . '/' . phpbb_get_files_dir() . '/thumbs/'; - + if ($handle = @opendir($src_path)) { while ($entry = readdir($handle)) @@ -1449,13 +1449,13 @@ function phpbb_attachment_forum_perms($forum_permissions) $pos--; continue; } - + $forum_auth = substr($forum_permissions, $pos, $auth_len); $forum_id = base64_unpack($forum_auth); $forum_ids[] = (int) $forum_id; } - + if (sizeof($forum_ids)) { return attachment_forum_perms($forum_ids); @@ -1534,7 +1534,7 @@ function phpbb_import_avatar($user_avatar) function phpbb_get_avatar_height($user_avatar) { global $convert_row; - + if (empty($convert_row['user_avatar_type'])) { return 0; @@ -1554,7 +1554,7 @@ function phpbb_get_avatar_width($user_avatar) { return 0; } - + return get_avatar_width($user_avatar, 'phpbb_avatar_type', $convert_row['user_avatar_type']); } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 583ec0861f..996deb0339 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -83,7 +83,6 @@ else } $user = new user(); -$cache = new acm(); $db = new $sql_db(); // Connect to DB @@ -652,7 +651,7 @@ _write_result($no_updates, $errored, $error_ary); if (!$inline_update) { // Purge the cache... - $cache->purge(); + phpbb::$acm->purge(); ?> <p style="color:red"><?php echo $lang['UPDATE_FILES_NOTICE']; ?></p> @@ -676,7 +675,7 @@ else add_log('admin', 'LOG_UPDATE_DATABASE', $orig_version, $updates_to_version); // Now we purge the session table as well as all cache files -$cache->purge(); +phpbb::$acm->purge(); ?> diff --git a/phpBB/install/index.php b/phpBB/install/index.php index f918a01786..ac8796feb2 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -240,7 +240,6 @@ set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handle $user = new user(); $auth = new auth(); -$cache = new acm(); $template = new template(); // Set some standard variables we want to force diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 552fb7a113..0a2d1b5d44 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -90,7 +90,7 @@ class install_convert extends module function main($mode, $sub) { - global $lang, $template, $cache, $config, $language, $table_prefix; + global $lang, $template, $config, $language, $table_prefix; global $convert; $this->tpl_name = 'install_convert'; @@ -213,7 +213,7 @@ class install_convert extends module // If we reached this step (conversion completed) we want to purge the cache and log the user out. // This is for making sure the session get not screwed due to the 3.0.x users table being completely new. - $cache->purge(); + phpbb::$acm->purge(); require(PHPBB_ROOT_PATH . 'config.' . PHP_EXT); require(PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT); @@ -333,7 +333,7 @@ class install_convert extends module */ function get_convert_settings($sub) { - global $lang, $language, $template, $db, $config, $cache; + global $lang, $language, $template, $db, $config; require(PHPBB_ROOT_PATH . 'config.' . PHP_EXT); require(PHPBB_ROOT_PATH . 'includes/constants.' . PHP_EXT); @@ -581,7 +581,7 @@ class install_convert extends module */ function convert_data($sub) { - global $template, $user, $db, $lang, $config, $cache; + global $template, $user, $db, $lang, $config; global $convert, $convert_row, $message_parser, $skip_rows, $language; require(PHPBB_ROOT_PATH . 'config.' . PHP_EXT); @@ -1438,7 +1438,7 @@ class install_convert extends module */ function sync_forums($sync_batch) { - global $template, $user, $db, $config, $cache; + global $template, $user, $db, $config; global $convert; $template->assign_block_vars('checks', array( @@ -1578,7 +1578,7 @@ class install_convert extends module */ function final_jump($final_jump) { - global $template, $user, $src_db, $same_db, $db, $config, $cache; + global $template, $user, $src_db, $same_db, $db, $config; global $convert; $template->assign_block_vars('checks', array( @@ -1617,7 +1617,7 @@ class install_convert extends module */ function jump($jump, $last_statement) { - global $template, $user, $src_db, $same_db, $db, $config, $cache; + global $template, $user, $src_db, $same_db, $db, $config; global $convert; $template->assign_block_vars('checks', array( @@ -1743,7 +1743,7 @@ class install_convert extends module // TODO: sync() is likely going to bomb out on forums with a considerable amount of topics. // TODO: the sync function is able to handle FROM-TO values, we should use them here (batch processing) sync('forum', '', '', false, true); - $cache->destroy('sql', FORUMS_TABLE); + phpbb::$acm->destroy_sql(FORUMS_TABLE); $template->assign_block_vars('checks', array( 'TITLE' => $user->lang['SYNC_FORUMS'], @@ -1920,7 +1920,7 @@ class install_convert extends module */ function process_row(&$schema, &$sql_data, &$insert_values) { - global $template, $user, $db, $lang, $config, $cache; + global $template, $user, $db, $lang, $config; global $convert, $convert_row; $sql_flag = false; diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 28ee7a95ff..a396c04dc5 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, $cache, $auth; + global $template, $user, $db, $config, $auth; $this->tpl_name = 'install_update'; $this->page_title = 'UPDATE_INSTALLATION'; @@ -122,17 +122,17 @@ class install_update extends module // If we are within the intro page we need to make sure we get up-to-date version info if ($sub == 'intro') { - $cache->destroy('_version_info'); + phpbb::$acm->destroy('version_info'); } // Set custom template again. ;) $template->set_custom_template('../adm/style', 'admin'); // Get current and latest version - if (($latest_version = $cache->get('_version_info')) === false) + if (($latest_version = phpbb::$acm->get('version_info')) === false) { $this->latest_version = $this->get_file('version_info'); - $cache->put('_version_info', $this->latest_version); + phpbb::$acm->put('version_info', $this->latest_version); } else { @@ -224,8 +224,8 @@ class install_update extends module )); // Make sure the update list is destroyed. - $cache->destroy('_update_list'); - $cache->destroy('_diff_files'); + phpbb::$acm->destroy('update_list'); + phpbb::$acm->destroy('diff_files'); break; case 'version_check': @@ -273,7 +273,7 @@ class install_update extends module } // Just a precaution - $cache->purge(); + phpbb::$acm->purge(); // Redirect the user to the database update script with some explanations... $template->assign_vars(array( @@ -289,7 +289,7 @@ class install_update extends module case 'file_check': // Make sure the previous file collection is no longer valid... - $cache->destroy('_diff_files'); + phpbb::$acm->destroy('diff_files'); $this->page_title = 'STAGE_FILE_CHECK'; @@ -297,8 +297,8 @@ class install_update extends module $action = request_var('action', ''); // We are directly within an update. To make sure our update list is correct we check its status. - $update_list = (phpbb_request::variable('check_again', false, false, phpbb_request::POST)) ? false : $cache->get('_update_list'); - $modified = ($update_list !== false) ? @filemtime($cache->cache_dir . 'data_update_list.' . PHP_EXT) : 0; + $update_list = (phpbb_request::variable('check_again', false, false, phpbb_request::POST)) ? false : phpbb::$acm->get('update_list'); + $modified = ($update_list !== false) ? phpbb::$acm->get_modified_date('data', 'update_list') : 0; // Make sure the list is up-to-date if ($update_list !== false) @@ -326,7 +326,7 @@ class install_update extends module if ($get_new_list) { $this->get_update_structure($update_list); - $cache->put('_update_list', $update_list); + phpbb::$acm->put('update_list', $update_list); // Refresh the page if we are still not finished... if ($update_list['status'] != -1) @@ -497,7 +497,7 @@ class install_update extends module WHERE theme_id = ' . $theme['theme_id']; $db->sql_query($sql); - $cache->destroy('sql', STYLES_THEME_TABLE); + phpbb::$acm->destroy_sql(STYLES_THEME_TABLE); } } @@ -505,7 +505,7 @@ class install_update extends module $db->sql_query('DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'version_update_from'"); $db->sql_return_on_error(false); - $cache->purge(); + phpbb::$acm->purge(); } break; @@ -544,7 +544,7 @@ class install_update extends module } // Before the user is choosing his preferred method, let's create the content list... - $update_list = $cache->get('_update_list'); + $update_list = phpbb::$acm->get('update_list'); if ($update_list === false) { @@ -601,7 +601,7 @@ class install_update extends module // Before we do anything, let us diff the files and store the raw file information "somewhere" $get_files = false; - $file_list = $cache->get('_diff_files'); + $file_list = phpbb::$acm->get('diff_files'); if ($file_list === false || $file_list['status'] != -1) { @@ -642,7 +642,7 @@ class install_update extends module // Refresh if we reach 5 diffs... if ($processed >= 5) { - $cache->put('_diff_files', $file_list); + phpbb::$acm->put('diff_files', $file_list); if (request_var('download', false)) { @@ -687,8 +687,8 @@ class install_update extends module break; } - $file_list[$file_struct['filename']] = '_file_' . md5($file_struct['filename']); - $cache->put($file_list[$file_struct['filename']], base64_encode($contents)); + $file_list[$file_struct['filename']] = 'file_' . md5($file_struct['filename']); + phpbb::$acm->put($file_list[$file_struct['filename']], base64_encode($contents)); $file_list['status']++; $processed++; @@ -732,8 +732,8 @@ class install_update extends module break; } - $file_list[$file_struct['filename']] = '_file_' . md5($file_struct['filename']); - $cache->put($file_list[$file_struct['filename']], base64_encode($contents)); + $file_list[$file_struct['filename']] = 'file_' . md5($file_struct['filename']); + phpbb::$acm->put($file_list[$file_struct['filename']], base64_encode($contents)); $file_list['status']++; $processed++; @@ -745,7 +745,7 @@ class install_update extends module } $file_list['status'] = -1; - $cache->put('_diff_files', $file_list); + phpbb::$acm->put('diff_files', $file_list); if (request_var('download', false)) { @@ -784,7 +784,7 @@ class install_update extends module ); // To ease the update process create a file location map - $update_list = $cache->get('_update_list'); + $update_list = phpbb::$acm->get('update_list'); $script_path = ($config['force_server_vars']) ? (($config['script_path'] == '/') ? '/' : $config['script_path'] . '/') : $user->page['root_script_path']; foreach ($update_list as $status => $files) @@ -974,7 +974,7 @@ class install_update extends module case 'modified': - $contents = base64_decode($cache->get($file_list[$file_struct['filename']])); + $contents = base64_decode(phpbb::$acm->get($file_list[$file_struct['filename']])); if ($update_mode == 'download') { @@ -990,7 +990,7 @@ class install_update extends module case 'conflict': - $contents = base64_decode($cache->get($file_list[$file_struct['filename']])); + $contents = base64_decode(phpbb::$acm->get($file_list[$file_struct['filename']])); if ($update_mode == 'download') { |
