You are here

function backup_migrate_shutdown in Backup and Migrate 7.3

Same name and namespace in other branches
  1. 8.2 backup_migrate.module \backup_migrate_shutdown()
  2. 8.3 backup_migrate.module \backup_migrate_shutdown()
  3. 6.3 backup_migrate.module \backup_migrate_shutdown()
  4. 6.2 backup_migrate.module \backup_migrate_shutdown()
  5. 7.2 backup_migrate.module \backup_migrate_shutdown()

Shutdown callback.

Called when the script terminates even if the script timed out.

2 string references to 'backup_migrate_shutdown'
backup_migrate_perform_backup in ./backup_migrate.module
Perform a backup with the given settings.
backup_migrate_perform_restore in ./backup_migrate.module
Restore from a file in the given destination.

File

./backup_migrate.module, line 1838
Backup and restore databases for Drupal.

Code

function backup_migrate_shutdown($settings) {

  // If we ran out of time, set an error so the user knows what happened.
  if (_backup_migrate_check_timeout()) {
    backup_migrate_cleanup();
    backup_migrate_backup_fail('The operation timed out. Try increasing your PHP <a href="!url">max_execution_time setting</a>.', array(
      '!url' => 'http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time',
    ), $settings);

    // The session will have already been written and closed, so we need to
    // write any changes directly.
    _drupal_session_write(session_id(), session_encode());

    // Add a redirect or we'll just get whitescreened.
    drupal_goto(BACKUP_MIGRATE_MENU_PATH);
  }
}