XPressME Integration Kit

Trac


Ignore:
Timestamp:
May 24, 2011, 10:06:28 AM (14 years ago)
Author:
toemon
Message:

Ver2.XからVer3.0へのアップグレード時wp-config.phpを上書きするようにする

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/update_xpress.php

    r745 r775  
    3333 */ 
    3434function update_xpress($from, $to) { 
    35         global $wp_filesystem, $_old_xpress_files, $wpdb; 
     35        global $wp_filesystem, $_old_xpress_files, $wpdb, $modInfo; 
    3636        show_message( __('Disable overwrite of wp-config.php...', 'xpressme') ); 
    37         // remove wp-config.php from the new version into place. 
    38         $wp_config = $from . 'wp-config.php'; 
    39         if ( !$wp_filesystem->delete($wp_config, true)){ 
    40                 return new WP_Error('delete_failed', $this->strings['delete_failed']); 
     37        $mod_ver = $modInfo->get_module_version(); 
     38        // Rewrite wp-config.php when update it to Ver.3 from Ver.2.  
     39        if (version_compare($mod_ver, '3.0', '>=')){ 
     40                // remove wp-config.php from the new version into place. 
     41                $wp_config = $from . 'wp-config.php'; 
     42                if ( !$wp_filesystem->delete($wp_config, true)){ 
     43                        return new WP_Error('delete_failed', $this->strings['delete_failed']); 
     44                } 
    4145        } 
    42  
    4346        // Copy new versions of XPressME Integration Kit files into place. 
    4447        show_message( __('Copy new versions of XPressME Integration Kit files into place...', 'xpressme') ); 
Note: See TracChangeset for help on using the changeset viewer.