[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/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: 968 lines (37 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Upgrader:: (13 methods):
  __construct()
  init()
  generic_strings()
  fs_connect()
  download_package()
  unpack_package()
  flatten_dirlist()
  clear_destination()
  install_package()
  run()
  maintenance_mode()
  create_lock()
  release_lock()


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.

since: 2.8.0
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`.

since: 2.8.0

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

since: 2.8.0

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

since: 2.8.0
return: bool|WP_Error True if able to connect, false or a WP_Error otherwise.
param: string[] $directories                  Optional. Array of directories. If any of these do
param: bool     $allow_relaxed_file_ownership Whether to allow relaxed file ownership.

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

since: 2.8.0
since: 5.2.0 Added the `$check_signatures` parameter.
since: 5.5.0 Added the `$hook_extra` parameter.
return: string|WP_Error The full path to the downloaded package file, or a WP_Error object.
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.
param: array  $hook_extra       Extra arguments to pass to the filter hooks. Default empty array.

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

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

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

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

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

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

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

Copies the contents of a package from 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.

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

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.

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

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

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

since: 2.8.0
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.

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

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

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



Generated: Fri Apr 26 01:00:03 2024 Cross-referenced by PHPXref 0.7.1