[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)




/wp-admin/includes/ -> class-wp-upgrader.php (summary)

Upgrade API: WP_Upgrader class Requires skin classes and WP_Upgrader subclasses for backward compatibility.

File Size: 946 lines (36 kb)
Included or required: 18 times
Referenced: 0 times
Includes or requires: 17 files

Defines 1 class

WP_Upgrader:: (13 methods):

Class: WP_Upgrader  - X-Ref

Core class used for upgrading/installing a local set of files via
the Filesystem Abstraction classes from a Zip file.

__construct( $skin = null )   X-Ref
Construct the upgrader with a skin.

param: WP_Upgrader_Skin $skin The upgrader skin to use. Default is a WP_Upgrader_Skin.

init()   X-Ref
Initialize the upgrader.

This will set the relationship between the skin being used and this upgrader,
and also add the generic strings to `WP_Upgrader::$strings`.

generic_strings()   X-Ref
Add the generic strings to WP_Upgrader::$strings.

fs_connect( $directories = array()   X-Ref
Connect to the filesystem.

param: array $directories                  Optional. A list of directories. If any of these do
param: bool  $allow_relaxed_file_ownership Whether to allow relaxed file ownership.
return: bool|WP_Error True if able to connect, false or a WP_Error otherwise.

download_package( $package, $check_signatures = false )   X-Ref
Download a package.

param: string $package          The URI of the package. If this is the full path to an
param: bool   $check_signatures Whether to validate file signatures. Default false.
return: string|WP_Error The full path to the downloaded package file, or a WP_Error object.

unpack_package( $package, $delete_package = true )   X-Ref
Unpack a compressed package file.

param: string $package        Full path to the package file.
param: bool   $delete_package Optional. Whether to delete the package file after attempting
return: string|WP_Error The path to the unpacked contents, or a WP_Error on failure.

flatten_dirlist( $nested_files, $path = '' )   X-Ref
Flatten the results of WP_Filesystem::dirlist() for iterating over.

param: array  $nested_files  Array of files as returned by WP_Filesystem::dirlist()
param: string $path          Relative path to prepend to child nodes. Optional.
return: array $files A flattened array of the $nested_files specified.

clear_destination( $remote_destination )   X-Ref
Clears the directory where this item is going to be installed into.

param: string $remote_destination The location on the remote filesystem to be cleared
return: bool|WP_Error True upon success, WP_Error on failure.

install_package( $args = array()   X-Ref
Install a package.

Copies the contents of a package form a source directory, and installs them in
a destination directory. Optionally removes the source. It can also optionally
clear out the destination folder if it already exists.

param: array|string $args {
return: array|WP_Error The result (also stored in `WP_Upgrader::$result`), or a WP_Error on failure.

run( $options )   X-Ref
Run an upgrade/installation.

Attempts to download the package (if it is not a local file), unpack it, and
install it in the destination folder.

param: array $options {
return: array|false|WP_error The result from self::install_package() on success, otherwise a WP_Error,

maintenance_mode( $enable = false )   X-Ref
Toggle maintenance mode for the site.

Creates/deletes the maintenance file to enable/disable maintenance mode.

param: bool $enable True to enable maintenance mode, false to disable.

create_lock( $lock_name, $release_timeout = null )   X-Ref
Creates a lock using WordPress options.

param: string $lock_name       The name of this unique lock.
param: int    $release_timeout Optional. The duration in seconds to respect an existing lock.
return: bool False if a lock couldn't be created or if the lock is still valid. True otherwise.

release_lock( $lock_name )   X-Ref
Releases an upgrader lock.

param: string $lock_name The name of this unique lock.
return: bool True if the lock was successfully released. False on failure.

Generated: Tue May 21 08:20:01 2019 Cross-referenced by PHPXref 0.7