update.manager.inc

Administrative screens and processing functions of the Update Manager module.

This allows site administrators with the 'administer software updates' permission to either upgrade existing projects, or download and install new ones, so long as the killswitch setting ('allow_authorize_operations') is not FALSE.

To install new code, the administrator is prompted for either the URL of an archive file, or to directly upload the archive file. The archive is loaded into a temporary location, extracted, and verified. If everything is successful, the user is redirected to authorize.php to type in file transfer credentials and authorize the installation to proceed with elevated privileges, such that the extracted files can be copied out of the temporary location and into the live web root.

Updating existing code is a more elaborate process. The first step is a selection form where the user is presented with a table of installed projects that are missing newer releases. The user selects which projects they wish to update, and presses the "Download updates" button to continue. This sets up a batch to fetch all the selected releases, and redirects to admin/update/download to display the batch progress bar as it runs. Each batch operation is responsible for downloading a single file, extracting the archive, and verifying the contents. If there are any errors, the user is redirected back to the first page with the error messages. If all downloads were extracted and verified, the user is instead redirected to admin/update/ready, a landing page which reminds them to backup their database and asks if they want to put the site offline during the update. Once the user presses the "Install updates" button, they are redirected to authorize.php to supply their web root file access credentials. The authorized operation (which lives in update.authorize.inc) sets up a batch to copy each extracted update from the temporary location into the live web root.

File

core/modules/update/update.manager.inc

Functions

Name Description
update_manager_archive_extract Unpacks a downloaded archive file.
update_manager_archive_verify Verifies an archive after it has been downloaded and extracted.
update_manager_batch_project_get Implements callback_batch_operation().
update_manager_download_batch_finished Batch callback: Performs actions when the download batch is completed.
update_manager_file_get Copies a file from the specified URL to the temporary directory for updates.
update_manager_local_transfers_allowed Determines if file transfers will be performed locally.
_update_manager_check_backends Checks for file transfer backends and prepares a form fragment about them.
doc_Drupal
2016-10-29 09:50:36
Comments
Leave a Comment

Please login to continue.