update_authorize_run_update($filetransfer, $projects)
Updates existing projects when invoked by authorize.php.
Callback for system_authorized_init() in update_manager_update_ready_form_submit().
$filetransfer: The FileTransfer object created by authorize.php for use during this operation.
$projects: A nested array of projects to install into the live webroot, keyed by project name. Each subarray contains the following keys:
\Symfony\Component\HttpFoundation\Response|null The result of processing the batch that updates the projects. If this is an instance of \Symfony\Component\HttpFoundation\Response the calling code should use that response for the current page request.
function update_authorize_run_update($filetransfer, $projects) { $operations = array(); foreach ($projects as $project_info) { $operations[] = array( 'update_authorize_batch_copy_project', array( $project_info['project'], $project_info['updater_name'], $project_info['local_url'], $filetransfer, ), ); } $batch = array( 'init_message' => t('Preparing to update your site'), 'operations' => $operations, 'finished' => 'update_authorize_update_batch_finished', 'file' => drupal_get_path('module', 'update') . '/update.authorize.inc', ); batch_set($batch); // Since authorize.php has its own method for setting the page title, set it // manually here rather than passing it in to batch_set() as would normally // be done. $_SESSION['authorize_page_title'] = t('Installing updates'); // Invoke the batch via authorize.php. return system_authorized_batch_process(); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!update!update.authorize.inc/function/update_authorize_run_update/8.1.x