Changeset 7028 for trunk/tests/includes/install.php
- Timestamp:
- 05/09/2013 01:05:45 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/includes/install.php
r6942 r7028 38 38 39 39 // Check if BuddyPress has already been installed 40 $db_version = bp_get_db_version_raw(); 40 $db_version = buddypress()->db_version; 41 $hash = $db_version . ' ' . (int) $multisite . ' ' . sha1_file( $config_file_path ); 41 42 42 43 if ( $db_version && file_exists( BP_TESTS_DB_VERSION_FILE ) ) { 43 $ file_version= file_get_contents( BP_TESTS_DB_VERSION_FILE );44 $version_file = file_get_contents( BP_TESTS_DB_VERSION_FILE ); 44 45 45 if ( $ db_version == (int) $file_version )46 if ( $hash === $version_file ) { 46 47 return; 48 } 47 49 } 48 50 49 51 echo "Installing BuddyPress...\n"; 50 52 53 // Make sure that BP has been cleaned from all blogs before reinstalling 54 $blogs = is_multisite() ? $wpdb->get_col( "SELECT blog_id FROM {$wpdb->blogs}" ) : array( 1 ); 55 foreach ( $blogs as $blog ) { 56 if ( is_multisite() ) { 57 switch_to_blog(); 58 } 59 60 $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '%bp%'" ); 61 62 if ( is_multisite() ) { 63 restore_current_blog(); 64 } 65 } 66 51 67 // Install BuddyPress 52 68 bp_version_updater(); 53 69 54 file_put_contents( BP_TESTS_DB_VERSION_FILE, bp_get_db_version_raw());70 file_put_contents( BP_TESTS_DB_VERSION_FILE, $hash );
Note: See TracChangeset
for help on using the changeset viewer.