Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extract() function #284

Merged
merged 1 commit into from
Mar 29, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions class-tgm-plugin-activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -1860,12 +1860,11 @@ public function run( $options ) {
'hook_extra' => array(),
);

// Parse default options with config options from $this->bulk_upgrade and extract them.
// Parse default options with config options from $this->bulk_upgrade.
$options = wp_parse_args( $options, $defaults );
extract( $options );

// Connect to the Filesystem.
$res = $this->fs_connect( array( WP_CONTENT_DIR, $destination ) );
$res = $this->fs_connect( array( WP_CONTENT_DIR, $options['destination'] ) );
if ( ! $res ) {
return false;
}
Expand All @@ -1877,22 +1876,22 @@ public function run( $options ) {
}

// Call $this->header separately if running multiple times.
if ( ! $is_multi )
if ( ! $options['is_multi'] )
$this->skin->header();

// Set strings before the package is installed.
$this->skin->before();

// Download the package (this just returns the filename of the file if the package is a local file).
$download = $this->download_package( $package );
$download = $this->download_package( $options['package'] );
if ( is_wp_error( $download ) ) {
$this->skin->error( $download );
$this->skin->after();
return $download;
}

// Don't accidentally delete a local file.
$delete_package = ( $download != $package );
$delete_package = ( $download != $options['package'] );

// Unzip file into a temporary working directory.
$working_dir = $this->unpack_package( $download, $delete_package );
Expand All @@ -1906,10 +1905,10 @@ public function run( $options ) {
$result = $this->install_package(
array(
'source' => $working_dir,
'destination' => $destination,
'clear_destination' => $clear_destination,
'clear_working' => $clear_working,
'hook_extra' => $hook_extra,
'destination' => $options['destination'],
'clear_destination' => $options['clear_destination'],
'clear_working' => $options['clear_working'],
'hook_extra' => $options['hook_extra'],
)
);

Expand All @@ -1932,7 +1931,7 @@ public function run( $options ) {
wp_cache_flush();

// Get the installed plugin file and activate it.
$plugin_info = $this->plugin_info( $package );
$plugin_info = $this->plugin_info( $options['package'] );
$activate = activate_plugin( $plugin_info );

// Re-populate the file path now that the plugin has been installed and activated.
Expand All @@ -1954,7 +1953,7 @@ public function run( $options ) {

// Set install footer strings.
$this->skin->after();
if ( ! $is_multi ) {
if ( ! $options['is_multi'] ) {
$this->skin->footer();
}

Expand Down