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() ) {
|
function fs_connect( $directories = array() ) {
|
||||||
global $wp_filesystem;
|
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;
|
return false;
|
||||||
|
|
||||||
if ( ! WP_Filesystem($credentials) ) {
|
if ( ! WP_Filesystem($credentials) ) {
|
||||||
|
@ -258,9 +258,6 @@ class WP_Upgrader {
|
||||||
$options = wp_parse_args($options, $defaults);
|
$options = wp_parse_args($options, $defaults);
|
||||||
extract($options);
|
extract($options);
|
||||||
|
|
||||||
$this->skin->header();
|
|
||||||
$this->skin->before();
|
|
||||||
|
|
||||||
//Connect to the Filesystem first.
|
//Connect to the Filesystem first.
|
||||||
$res = $this->fs_connect( array(WP_CONTENT_DIR, $destination) );
|
$res = $this->fs_connect( array(WP_CONTENT_DIR, $destination) );
|
||||||
if ( ! $res ) //Mainly for non-connected filesystem.
|
if ( ! $res ) //Mainly for non-connected filesystem.
|
||||||
|
@ -271,6 +268,9 @@ class WP_Upgrader {
|
||||||
return $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 the package (Note, This just returns the filename of the file if the package is a local file)
|
||||||
$download = $this->download_package( $package );
|
$download = $this->download_package( $package );
|
||||||
if ( is_wp_error($download) ) {
|
if ( is_wp_error($download) ) {
|
||||||
|
|
|
@ -77,11 +77,7 @@ if ( isset($_GET['action']) ) {
|
||||||
|
|
||||||
$title = sprintf( __('Installing Plugin: %s'), $api->name . ' ' . $api->version );
|
$title = sprintf( __('Installing Plugin: %s'), $api->name . ' ' . $api->version );
|
||||||
$nonce = 'install-plugin_' . $plugin;
|
$nonce = 'install-plugin_' . $plugin;
|
||||||
$url = add_query_arg( array(
|
$url = 'update.php?action=install-plugin&plugin=' . $plugin;
|
||||||
'plugin' => $plugin,
|
|
||||||
'plugin_name' => $api->name . ' ' . $api->version,
|
|
||||||
'download_url' => $api->download_link
|
|
||||||
), 'update.php?action=install-plugin');
|
|
||||||
$type = 'web'; //Install plugin type, From Web or an Upload.
|
$type = 'web'; //Install plugin type, From Web or an Upload.
|
||||||
|
|
||||||
$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
|
$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 );
|
$title = sprintf( __('Installing theme: %s'), $api->name . ' ' . $api->version );
|
||||||
$nonce = 'install-theme_' . $theme;
|
$nonce = 'install-theme_' . $theme;
|
||||||
$url = add_query_arg( array(
|
$url = 'update.php?action=install-theme&theme=' . $theme;
|
||||||
'theme' => $theme,
|
|
||||||
'theme_name' => $api->name . ' ' . $api->version,
|
|
||||||
'download_url' => $api->download_link
|
|
||||||
), 'update.php?action=install-theme');
|
|
||||||
$type = 'web'; //Install theme type, From Web or an Upload.
|
$type = 'web'; //Install theme type, From Web or an Upload.
|
||||||
|
|
||||||
$upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
|
$upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
|
||||||
|
|
Loading…
Reference in New Issue