Install/upgrade cleanups. Props DD32, sivel. see #7875

git-svn-id: http://svn.automattic.com/wordpress/trunk@11012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-04-20 18:15:08 +00:00
parent 67533a8584
commit 79c63cfe7d
2 changed files with 7 additions and 15 deletions

View File

@ -54,7 +54,7 @@ class WP_Upgrader {
function fs_connect( $directories = array() ) {
global $wp_filesystem;
if ( false === ($credentials = $this->skin->request_filesystem_credentials()) ) //request_filesystem_credentials($url)) )
if ( false === ($credentials = $this->skin->request_filesystem_credentials()) )
return false;
if ( ! WP_Filesystem($credentials) ) {
@ -258,9 +258,6 @@ class WP_Upgrader {
$options = wp_parse_args($options, $defaults);
extract($options);
$this->skin->header();
$this->skin->before();
//Connect to the Filesystem first.
$res = $this->fs_connect( array(WP_CONTENT_DIR, $destination) );
if ( ! $res ) //Mainly for non-connected filesystem.
@ -271,6 +268,9 @@ class WP_Upgrader {
return $res;
}
$this->skin->header();
$this->skin->before();
//Download the package (Note, This just returns the filename of the file if the package is a local file)
$download = $this->download_package( $package );
if ( is_wp_error($download) ) {

View File

@ -77,11 +77,7 @@ if ( isset($_GET['action']) ) {
$title = sprintf( __('Installing Plugin: %s'), $api->name . ' ' . $api->version );
$nonce = 'install-plugin_' . $plugin;
$url = add_query_arg( array(
'plugin' => $plugin,
'plugin_name' => $api->name . ' ' . $api->version,
'download_url' => $api->download_link
), 'update.php?action=install-plugin');
$url = 'update.php?action=install-plugin&plugin=' . $plugin;
$type = 'web'; //Install plugin type, From Web or an Upload.
$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
@ -157,11 +153,7 @@ if ( isset($_GET['action']) ) {
$title = sprintf( __('Installing theme: %s'), $api->name . ' ' . $api->version );
$nonce = 'install-theme_' . $theme;
$url = add_query_arg( array(
'theme' => $theme,
'theme_name' => $api->name . ' ' . $api->version,
'download_url' => $api->download_link
), 'update.php?action=install-theme');
$url = 'update.php?action=install-theme&theme=' . $theme;
$type = 'web'; //Install theme type, From Web or an Upload.
$upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );