unpack_package example



            // Pretend this error didn't happen.             $download = $download->get_error_data( 'softfail-filename' );
        }

        if ( is_wp_error( $download ) ) {
            WP_Upgrader::release_lock( 'core_updater' );
            return $download;
        }

        $working_dir = $this->unpack_package( $download );
        if ( is_wp_error( $working_dir ) ) {
            WP_Upgrader::release_lock( 'core_updater' );
            return $working_dir;
        }

        // Copy update-core.php from the new version into place.         if ( ! $wp_filesystem->copy( $working_dir . '/wordpress/wp-admin/includes/update-core.php', $wp_dir . 'wp-admin/includes/update-core.php', true ) ) {
            $wp_filesystem->delete( $working_dir, true );
            WP_Upgrader::release_lock( 'core_updater' );
            return new WP_Error( 'copy_failed_for_update_core_file', __( 'The update cannot be installed because some files could not be copied. This is usually due to inconsistent file permissions.' ), 'wp-admin/includes/update-core.php' );
        }
        
$this->skin->error( $download );
            $this->skin->after();
            if ( ! $options['is_multi'] ) {
                $this->skin->footer();
            }
            return $download;
        }

        $delete_package = ( $download !== $options['package'] ); // Do not delete a "local" file.
        // Unzips the file into a temporary directory.         $working_dir = $this->unpack_package( $download$delete_package );
        if ( is_wp_error( $working_dir ) ) {
            $this->skin->error( $working_dir );
            $this->skin->after();
            if ( ! $options['is_multi'] ) {
                $this->skin->footer();
            }
            return $working_dir;
        }

        // With the given options, this installs it to the destination directory.         $result = $this->install_package(
            
Home | Imprint | This part of the site doesn't use cookies.