Changeset 7155 for trunk/wp-admin/includes/update.php
- Timestamp:
- 03/04/2008 05:10:17 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/update.php
r7130 r7155 141 141 return new WP_Error('fs_error', __('Filesystem error'), $wp_filesystem->errors); 142 142 143 //Get the Base folder 144 $base = $wp_filesystem->get_base_dir(); 145 143 146 // Get the URL to the zip file 144 147 $r = $current->response[ $plugin ]; … … 149 152 // Download the package 150 153 $package = $r->package; 151 apply_filters('update_feedback', __("Downloading update from $package"));154 apply_filters('update_feedback', sprintf(__("Downloading update from %s"), $package)); 152 155 $file = download_url($package); 153 156 … … 156 159 157 160 $name = basename($plugin, '.php'); 158 $working_dir = ABSPATH. 'wp-content/upgrade/' . $name;161 $working_dir = $base . 'wp-content/upgrade/' . $name; 159 162 160 163 // Clean up working directory … … 176 179 // Remove the existing plugin. 177 180 apply_filters('update_feedback', __("Removing the old version of the plugin")); 178 $plugin_dir = dirname(ABSPATH . PLUGINDIR . "/$plugin"); 181 $plugin_dir = dirname($base . PLUGINDIR . "/$plugin"); 182 $plugin_dir = trailingslashit($plugin_dir); 179 183 // If plugin is in its own directory, recursively delete the directory. 180 if ( '.' != $plugin_dir && ABSPATH. PLUGINDIR != $plugin_dir )184 if ( '.' != $plugin_dir && $base . PLUGINDIR != $plugin_dir ) 181 185 $deleted = $wp_filesystem->delete($plugin_dir, true); 182 186 else 183 $deleted = $wp_filesystem->delete( ABSPATH. PLUGINDIR . "/$plugin");187 $deleted = $wp_filesystem->delete($base . PLUGINDIR . "/$plugin"); 184 188 if ( !$deleted ) { 185 189 $wp_filesystem->delete($working_dir, true); … … 189 193 apply_filters('update_feedback', __("Installing the latest version")); 190 194 // Copy new version of plugin into place. 191 if ( !copy_dir($working_dir, ABSPATH. PLUGINDIR) ) {195 if ( !copy_dir($working_dir, $base . PLUGINDIR) ) { 192 196 //$wp_filesystem->delete($working_dir, true); 193 197 return new WP_Error('install_failed', __('Installation failed'));
Note: See TracChangeset
for help on using the changeset viewer.