Changeset 839 in tests
- Timestamp:
- 07/01/2012 10:10:46 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/install.php
r760 r839 27 27 28 28 $wpdb->suppress_errors(); 29 $wpdb->hide_errors();30 29 $installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" ); 30 $wpdb->suppress_errors( false ); 31 31 32 if ( $installed && file_exists( WP_TESTS_VERSION_FILE ) ) { 33 $installed_version_hash = file_get_contents( WP_TESTS_VERSION_FILE ); 34 if ( $installed_version_hash == test_version_check_hash() ) { 32 $hash = get_option( 'db_version' ) . ' ' . sha1( file_get_contents( $config_file_path ) ); 33 34 if ( $installed && file_exists( WP_TESTS_VERSION_FILE ) && file_get_contents( WP_TESTS_VERSION_FILE ) == $hash ) 35 35 return; 36 } 37 } 36 38 37 $wpdb->query( 'SET storage_engine = INNODB;' ); 39 38 $wpdb->query( 'DROP DATABASE IF EXISTS '.DB_NAME.";" ); … … 42 41 43 42 echo "Installing…" . PHP_EOL; 44 wp_install( WP_TESTS_TITLE, 'admin', WP_TESTS_EMAIL, true, '', 'a' );43 wp_install( WP_TESTS_TITLE, 'admin', WP_TESTS_EMAIL, true, null, 'password' ); 45 44 46 if ( defined( 'WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE ) {47 echo "Installing network…" . PHP_EOL;45 if ( defined( 'WP_TESTS_MULTISITE' ) && WP_TESTS_MULTISITE ) { 46 echo "Installing network…" . PHP_EOL; 48 47 49 48 define( 'WP_INSTALLING_NETWORK', true ); 50 //wp_set_wpdb_vars(); 51 // We need to create references to ms global tables to enable Network.49 50 // We need to create references to ms global tables. 52 51 foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) 53 52 $wpdb->$table = $prefixed_table; 53 54 $title = WP_TESTS_TITLE . ' Network'; 55 $subdomain_install = false; 56 54 57 install_network(); 55 $result = populate_network(1, WP_TESTS_DOMAIN, WP_TESTS_EMAIL, WP_TESTS_NETWORK_TITLE, '/', WP_TESTS_SUBDOMAIN_INSTALL); 56 57 system( WP_PHP_BINARY . ' ' . escapeshellarg( dirname( __FILE__ ) . '/ms-install.php' ) . ' ' . escapeshellarg( $config_file_path ) ); 58 58 populate_network( 1, WP_TESTS_DOMAIN, WP_TESTS_EMAIL, $title, '/', $subdomain_install ); 59 59 } 60 60 61 file_put_contents( WP_TESTS_VERSION_FILE, test_version_check_hash());61 file_put_contents( WP_TESTS_VERSION_FILE, $hash ); -
trunk/bootstrap.php
r833 r839 31 31 system( WP_PHP_BINARY . ' ' . escapeshellarg( dirname( __FILE__ ) . '/bin/install.php' ) . ' ' . escapeshellarg( $config_file_path ) ); 32 32 33 if ( defined( 'WP_TESTS_MULTISITE' ) && WP_TESTS_MULTISITE ) { 34 define( 'MULTISITE', true ); 35 define( 'SUBDOMAIN_INSTALL', false ); 36 define( 'DOMAIN_CURRENT_SITE', WP_TESTS_DOMAIN ); 37 define( 'PATH_CURRENT_SITE', '/' ); 38 define( 'SITE_ID_CURRENT_SITE', 1 ); 39 define( 'BLOG_ID_CURRENT_SITE', 1 ); 40 $GLOBALS['base'] = '/'; 41 } 42 33 43 require dirname( __FILE__ ) . '/wp-testlib/functions.php'; 34 44 -
trunk/wp-testlib/functions.php
r807 r839 1 1 <?php 2 /**3 * Generate a hash to be used when comparing installed version against4 * codebase and current configuration5 * @return string $hash sha1 hash6 **/7 function test_version_check_hash() {8 $hash = '';9 $db_version = get_option( 'db_version' );10 if ( defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE ) {11 $version = $db_version;12 if( defined( 'WP_TESTS_BLOGS' ) ) {13 $version .= WP_TESTS_BLOGS;14 }15 if( defined( 'WP_TESTS_SUBDOMAIN_INSTALL' ) ) {16 $version .= WP_TESTS_SUBDOMAIN_INSTALL;17 }18 if( defined( 'WP_TESTS_DOMAIN' ) ) {19 $version .= WP_TESTS_DOMAIN;20 }21 22 } else {23 $version = $db_version;24 }25 26 return sha1($version);27 }28 2 29 3 // For adding hooks before loading WP
Note: See TracChangeset
for help on using the changeset viewer.