function process_s3_copy($s3file, $accesskey, $secretkey, $bucket, $directory, $ssl) { pb_backupbuddy::status('details', 'Copying remote S3 file `' . $s3file . '` down to local.'); pb_backupbuddy::set_greedy_script_limits(); require_once pb_backupbuddy::plugin_path() . '/destinations/s3/lib/s3.php'; $s3 = new pb_backupbuddy_S3($accesskey, $secretkey, $ssl); $destination_file = pb_backupbuddy::$options['backup_directory'] . $s3file; if (file_exists($destination_file)) { $destination_file = str_replace('backup-', 'backup_copy_' . pb_backupbuddy::random_string(5) . '-', $destination_file); } pb_backupbuddy::status('details', 'About to get S3 object...'); $s3->getObject($bucket, $directory . $s3file, $destination_file); pb_backupbuddy::status('details', 'S3 object retrieved.'); }