mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
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:
parent
67533a8584
commit
79c63cfe7d
@ -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.
|
||||
@ -270,7 +267,10 @@ class WP_Upgrader {
|
||||
$this->skin->error($res);
|
||||
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) ) {
|
||||
|
@ -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') ) );
|
||||
|
Loading…
Reference in New Issue
Block a user