Changeset 723 for trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/class-xpress-upgrader.php
- Timestamp:
- Apr 29, 2011, 2:20:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/class-xpress-upgrader.php
r704 r723 12 12 $this->strings['make_config'] = __('Delete source wp-config.php.', 'xpressme'); 13 13 $this->strings['delete_failed'] = __('Could not delete files.', 'xpressme'); 14 $this->strings['package_wrong'] = __('The structure of the package is wrong. ', 'xpressme'); 14 15 } 15 16 … … 40 41 if ( is_wp_error($working_dir) ) 41 42 return $working_dir; 42 $subdirs = $wp_filesystem->dirlist($working_dir,false); 43 foreach($subdirs as $subdir){ 44 $subdir_name = $subdir['name']; 43 $kit_dir = $working_dir .'/xpressme_integration_kit/'; 44 if (!file_exists($kit_dir)){ // search sub dir. 45 $kit_dir = ''; 46 $subdirs = $wp_filesystem->dirlist($working_dir,false); 47 foreach($subdirs as $subdir){ 48 if (file_exists($working_dir .'/' .$subdir['name'] .'/xpressme_integration_kit/')){ 49 $kit_dir = $working_dir .'/' .$subdir['name'] .'/xpressme_integration_kit/'; 50 continue; 51 } 52 } 53 if (empty($kit_dir)){ 54 $wp_filesystem->delete($working_dir, true); 55 return new WP_Error('package_wrong', $this->strings['package_wrong']); 56 } 45 57 } 46 47 $kit_dir = $working_dir .'/' .$subdir_name .'/xpressme_integration_kit/';48 49 58 // Copy update-core.php from the new version into place. 50 59 $update_xpress_file = 'wp-content/plugins/xpressme/include/update_xpress.php'; … … 59 68 } 60 69 } 61 70 ?>
Note: See TracChangeset
for help on using the changeset viewer.