[ 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.

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

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.

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

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

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.
since: 2.8.0
since: 5.2.0 Added the `$check_signatures` parameter.
since: 5.5.0 Added the `$hook_extra` parameter.

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

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

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

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

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

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

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.

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

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.

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

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

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

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

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

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



Generated: Thu Nov 21 01:00:03 2024 Cross-referenced by PHPXref 0.7.1