[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
Upgrade API: WP_Upgrader class Requires skin classes and WP_Upgrader subclasses for backward compatibility.
WP_Upgrader:: (17 methods):
__construct()
init()
schedule_temp_backup_cleanup()
generic_strings()
fs_connect()
download_package()
unpack_package()
flatten_dirlist()
clear_destination()
install_package()
run()
maintenance_mode()
create_lock()
release_lock()
move_to_temp_backup_dir()
restore_temp_backup()
delete_temp_backup()
Class: WP_Upgrader - X-Ref
Core class used for upgrading/installing a local set of files via__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 |
Initializes 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`. Additionally, it will schedule a weekly task to clean up the temporary backup directory. |
schedule_temp_backup_cleanup() X-Ref |
Schedules the cleanup of the temporary backup directory. |
generic_strings() X-Ref |
Adds the generic strings to WP_Upgrader::$strings. |
fs_connect( $directories = array() X-Ref |
Connects 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. |
download_package( $package, $check_signatures = false, $hook_extra = array() X-Ref |
Downloads 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. |
unpack_package( $package, $delete_package = true ) X-Ref |
Unpacks 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 |
flatten_dirlist( $nested_files, $path = '' ) X-Ref |
Flattens 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. |
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. |
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 { |
run( $options ) X-Ref |
Runs 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 { |
maintenance_mode( $enable = false ) X-Ref |
Toggles 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. 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. return: bool True if the lock was successfully released. False on failure. param: string $lock_name The name of this unique lock. |
move_to_temp_backup_dir( $args ) X-Ref |
Moves the plugin or theme being updated into a temporary backup directory. return: bool|WP_Error True on success, false on early exit, otherwise WP_Error. param: string[] $args { |
restore_temp_backup( array $temp_backups = array() X-Ref |
Restores the plugin or theme from temporary backup. return: bool|WP_Error True on success, false on early exit, otherwise WP_Error. param: array[] $temp_backups { |
delete_temp_backup( array $temp_backups = array() X-Ref |
Deletes a temporary backup. return: bool|WP_Error True on success, false on early exit, otherwise WP_Error. param: array[] $temp_backups { |
Generated : Sat Dec 21 08:20:01 2024 | Cross-referenced by PHPXref |