- Timestamp:
- Apr 20, 2011, 3:41:10 PM (14 years ago)
- Location:
- trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/class-xpress-upgrader.php
r698 r701 1 1 <?php 2 2 include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; 3 /** 4 * Core Upgrader class for WordPress. It allows for WordPress to upgrade itself in combiantion with the wp-admin/includes/update-core.php file 5 * 6 * @TODO More Detailed docs, for methods as well. 7 * 8 * @package WordPress 9 * @subpackage Upgrader 10 * @since 2.8.0 11 */ 3 12 4 class Xpress_Upgrader extends WP_Upgrader { 13 5 … … 57 49 // Copy update-core.php from the new version into place. 58 50 $update_xpress_file = 'wp-content/plugins/xpressme/include/update_xpress.php'; 59 //if ( !$wp_filesystem->copy($kit_dir . $update_xpress_file, $wp_dir . $update_xpress_file, true) ) {60 //$wp_filesystem->delete($working_dir, true);61 //return new WP_Error('copy_failed', $this->strings['copy_failed']);62 //}51 if ( !$wp_filesystem->copy($kit_dir . $update_xpress_file, $wp_dir . $update_xpress_file, true) ) { 52 $wp_filesystem->delete($working_dir, true); 53 return new WP_Error('copy_failed', $this->strings['copy_failed']); 54 } 63 55 $wp_filesystem->chmod($wp_dir . $update_xpress_file, FS_CHMOD_FILE); 64 56 65 57 require(ABSPATH . $update_xpress_file); 66 67 58 return update_xpress($kit_dir, $wp_dir); 68 69 // Remove working directory70 $wp_filesystem->delete($working_dir, true);71 if ( !$wp_filesystem->delete($working_dir, true)){72 return new WP_Error('delete_failed', $this->strings['delete_failed']);73 }74 show_message( __('Delete Working directory') );75 $wp_filesystem->chmod($wp_dir . 'templates/', 0777);76 59 } 77 60 } -
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/xpress_upgrade.php
r700 r701 4 4 return (object)$latest_version; 5 5 } 6 7 6 8 7 function list_xpress_update( $update=null ) { 9 8 global $xoops_config,$xpress_config; … … 26 25 } 27 26 28 27 $show_buttons = false; 29 28 if (version_compare($xpress_version, $latest_version, '>')){ 30 29 echo '<h3 class="response">'; 31 printf(__('You are using a XPressME Integration Kit development version (% 1$s). Cool! Please <a href="%2$s">stay updated</a>.', 'xpressme') , $xpress_version , $latest['develop_url']);30 printf(__('You are using a XPressME Integration Kit development version (%s). Cool! Please stay updated.', 'xpressme') , $xpress_version); 32 31 echo '</h3>'; 33 34 32 } else if (version_compare($xpress_version, $latest_version, '<')) { 35 33 echo '<h3 class="response">'; … … 38 36 39 37 if ($latest['diff_response'] == 'diff_exists'){ 40 // echo '<p>';41 // printf(__('You can download the differential file from version %s to %s and upgrade it manually:', 'xpressme'),$xpress_version,$latest['diff_latest_version']);42 // echo '</p>';43 38 $download_diff ='<a class="button" href="' . $latest['diff_package'] . '">'; 44 // $download_diff .= sprintf(__('Download differential file for %s', 'xpressme') , $latest['diff_latest_version']);45 39 $download_diff .= sprintf(__('Download differential file for %s', 'xpressme') , $xpress_version); 46 40 $download_diff .='</a>'; 47 41 } 48 $message = sprintf(__('You can update to <a href="http://codex.wordpress.org/Version_%1$s">XPressME Integration Kit Ver %2$s</a> automatically or download the package and install it manually:'), $update->current, $latest_version);42 $message = sprintf(__('You can update to XPressME Integration Kit Ver %s</a> automatically or download the package and install it manually:'), $latest_version); 49 43 $submit = __('Update Automatically'); 50 44 $form_action = 'admin.php?page=upgrade_page&action=do-xpress-upgrade'; … … 64 58 65 59 // develop 60 $develop_show = false; 66 61 if ($latest['develop_response'] == 'development_exists' 67 62 && !empty($latest['develop_package']) 68 63 ) 69 64 { 70 echo '<h3 class="response">'; 71 printf(__('You can use the development version %s download the package and install it manually:', 'xpressme'),$latest['develop_latest_version']); 72 echo '</h3>'; 73 echo '<a class="button" href="' . $latest['develop_package'] . '">'; 74 printf(__('Download %s', 'xpressme') , $latest['develop_latest_version']); 75 echo '</a>'; 65 $develop_latest_version=$latest['develop_latest_version']; 66 $develop_form_action = 'admin.php?page=upgrade_page&action=do-xpress-develop_upgrade'; 67 // $develop_message =sprintf(__('You can use the development version %s download the package and install it manually:', 'xpressme'),$latest['develop_latest_version']); 68 $develop_message = sprintf(__('You can update to XPressME Integration Kit development version %s automatically or download the package and install it manually:'), $develop_latest_version); 69 70 $develop_show = true; 71 $develop_package=$latest['develop_package']; 72 $develop_submit = __('Update Automatically'); 73 $develop_download = sprintf(__('Download %s', 'xpressme') , $develop_latest_version); 74 $develop_download_diff = ''; 76 75 // develop diff 77 76 if ($latest['diff_develop_response'] == 'diff_develop_exists' … … 79 78 ) 80 79 { 81 echo '<p>'; 82 printf(__('You can download the differential file from version %s to %s and upgrade it manually:', 'xpressme'),$xpress_version,$latest['diff_develop_latest_version']); 83 echo '</p>'; 84 echo '<a class="button" href="' . $latest['diff_develop_package'] . '">'; 85 printf(__('Download differential file for %s', 'xpressme') , $latest['diff_develop_latest_version']); 86 echo '</a>'; 80 $develop_download_diff = '<a class="button" href="' . $latest['diff_develop_package'] . '">'; 81 $develop_download_difff .= sprintf(__('Download differential file for %s', 'xpressme') , $latest['diff_develop_latest_version']); 82 $develop_download_diff .= '</a>'; 87 83 } 88 84 } … … 102 98 } 103 99 echo '</form>'; 100 101 if ($develop_show){ 102 echo '<p>'; 103 echo $develop_message; 104 echo '</p>'; 105 echo '<form method="post" action="' . $develop_form_action . '" name="develop_upgrade" class="develop_upgrade">'; 106 echo '<p>'; 107 echo '<input name="version" value="'. esc_attr($update->current) .'" type="hidden"/>'; 108 echo '<input name="locale" value="'. esc_attr($update->locale) .'" type="hidden"/>'; 109 echo '<input id="upgrade" class="button" type="submit" value="' . esc_attr($develop_submit) . '" name="develop_upgrade" /> '; 110 echo '<a href="' . esc_url($develop_package) . '" class="button">' . $develop_download . '</a> '; 111 echo $develop_download_diff; 112 echo '</form>'; 113 } 104 114 } else { 105 115 echo '<h3 class="response">'; … … 116 126 } 117 127 118 function do_xpress_upgrade( $ reinstall = false ) {128 function do_xpress_upgrade( $develop = false,$reinstall = false ) { 119 129 global $wp_filesystem; 120 130 … … 133 143 if ( !$update ) 134 144 return; 135 145 if ( $develop ) 146 $update->package = $update->develop_package; 136 147 137 148 if ( ! WP_Filesystem($credentials, ABSPATH) ) { … … 180 191 list_xpress_update(); 181 192 } elseif ( 'do-xpress-upgrade' == $action) { 182 do_xpress_upgrade(); 193 $update_develop = false; 194 do_xpress_upgrade($update_develop); 195 } else if ( 'do-xpress-develop_upgrade' == $action) { 196 $update_develop = true; 197 do_xpress_upgrade($update_develop); 183 198 } 184 199 }
Note: See TracChangeset
for help on using the changeset viewer.