Changeset 5309 for trunk/bp-core/admin/bp-core-update.php
- Timestamp:
- 11/08/2011 08:39:23 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/admin/bp-core-update.php
r5223 r5309 4 4 5 5 class BP_Core_Setup_Wizard { 6 7 /** 8 * @var int The current step of the updater 9 */ 6 10 var $current_step; 11 12 /** 13 * 14 * @var array The total steps to be completed 15 */ 7 16 var $steps; 8 17 9 var $database_version; 18 /** 19 * @var int Database version of current BuddyPress files 20 */ 21 var $db_version; 22 23 /** 24 * @var int Database version raw from the database connection 25 */ 26 var $db_version_raw; 27 28 /** 29 * @var int Are we currently network activated 30 */ 10 31 var $is_network_activate; 11 var $new_version; 32 33 /** 34 * @var string What kind of setup/update are we performing 35 */ 12 36 var $setup_type; 37 38 /** Functions *************************************************************/ 13 39 14 40 function bp_core_setup_wizard() { … … 24 50 25 51 // Get current DB version 26 $this->d atabase_version = !empty( $bp->database_version ) ? (int) $bp->database_version: 0;52 $this->db_version_raw = !empty( $bp->db_version_raw ) ? (int) $bp->db_version_raw : 0; 27 53 28 54 if ( !empty( $bp->is_network_activate ) ) { … … 34 60 } 35 61 36 $this-> new_version = constant( 'BP_DB_VERSION');62 $this->db_version = bp_get_db_version(); 37 63 $this->setup_type = !empty( $bp->maintenance_mode ) ? $bp->maintenance_mode : ''; 38 64 $this->current_step = $this->current_step(); … … 82 108 $steps[] = __( 'Multisite Update', 'buddypress' ); 83 109 84 if ( $this->d atabase_version < (int) $this->new_version )110 if ( $this->db_version_raw < (int) $this->db_version ) 85 111 $steps[] = __( 'Database Update', 'buddypress' ); 86 112 87 113 // New for BP 1.5 88 if ( $this->d atabase_version< 1801 || !bp_core_get_directory_page_ids() ) {114 if ( $this->db_version_raw < 1801 || !bp_core_get_directory_page_ids() ) { 89 115 $steps[] = __( 'Components', 'buddypress' ); 90 116 $steps[] = __( 'Pages', 'buddypress' ); … … 92 118 93 119 // New for BP 1.6 94 if ( $this->d atabase_version< 5222 && !defined( 'BP_USE_WP_ADMIN_BAR' ) )120 if ( $this->db_version_raw < 5222 && !defined( 'BP_USE_WP_ADMIN_BAR' ) ) 95 121 $steps[] = __( 'Admin Bar', 'buddypress' ); 96 122 … … 805 831 bp_core_install(); 806 832 807 if ( $this->d atabase_version< 1801 )833 if ( $this->db_version_raw < 1801 ) 808 834 $this->update_1_5(); 809 835 … … 829 855 // Transfer important settings from blog options to site options 830 856 $options = array( 831 ' bp-db-version' => $this->database_version,857 '_bp_db_version' => $this->db_version, 832 858 'bp-active-components' => $active_components, 833 859 'avatar-default' => get_option( 'avatar-default' ) … … 844 870 // Move bp-pages data from the blog options table to site options 845 871 $existing_pages = bp_get_option( 'bp-pages' ); 846 847 872 $bp_pages = $this->setup_pages( (array)$_POST['bp_pages'] ); 848 873 $bp_pages = array_merge( (array)$existing_pages, (array)$bp_pages ); … … 856 881 } 857 882 883 // Delete the old site option 884 delete_site_option( 'bp-db-version' ); 885 886 // Update the active components 858 887 bp_update_option( 'bp-active-components', $active_components ); 859 888 … … 1092 1121 // Update the DB version in the database 1093 1122 // Stored in sitemeta. Do not use bp_update_option() 1094 update_site_option( 'bp-db-version', $this-> new_version );1123 update_site_option( 'bp-db-version', $this->db_version ); 1095 1124 delete_site_option( 'bp-core-db-version' ); 1096 1125
Note: See TracChangeset
for help on using the changeset viewer.