update_authorize_install_batch_finished
function update_authorize_install_batch_finished
update_authorize_install_batch_finished($success, $results)
Implements callback_batch_finished().
Performs actions when the authorized install batch is done.
This processes the results and stashes them into SESSION such that authorize.php will render a report. Also responsible for putting the site back online after a successful install if necessary.
Parameters
$success: TRUE if the batch operation was a success; FALSE if there were errors.
$results: An associative array of results from the batch operation.
File
- modules/update/update.authorize.inc, line 255
- Callbacks and related functions invoked by authorize.php to update projects.
Code
function update_authorize_install_batch_finished($success, $results) { foreach ($results['log'] as $project => $messages) { if (!empty($messages['#abort'])) { $success = FALSE; } } $offline = variable_get('maintenance_mode', FALSE); if ($success) { // Take the site out of maintenance mode if it was previously that way. if ($offline && isset($_SESSION['maintenance_mode']) && $_SESSION['maintenance_mode'] == FALSE) { variable_set('maintenance_mode', FALSE); $page_message = array( 'message' => t('Installation was completed successfully. Your site has been taken out of maintenance mode.'), 'type' => 'status', ); } else { $page_message = array( 'message' => t('Installation was completed successfully.'), 'type' => 'status', ); } } elseif (!$success && !$offline) { $page_message = array( 'message' => t('Installation failed! See the log below for more information.'), 'type' => 'error', ); } else { $page_message = array( 'message' => t('Installation failed! See the log below for more information. Your site is still in maintenance mode.'), 'type' => 'error', ); } // Unset the variable since it is no longer needed. unset($_SESSION['maintenance_mode']); // Set all these values into the SESSION so authorize.php can display them. $_SESSION['authorize_results']['success'] = $success; $_SESSION['authorize_results']['page_message'] = $page_message; $_SESSION['authorize_results']['messages'] = $results['log']; $_SESSION['authorize_results']['tasks'] = $results['tasks']; $_SESSION['authorize_operation']['page_title'] = t('Update manager'); }
© 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/modules!update!update.authorize.inc/function/update_authorize_install_batch_finished/7.x