public/wordpress/wp-content/plugins/backupbuddy/destinations/s3/init.php
/* download_file()
	 *
	 * Download remote file to local system.
	 *
	 * @param	array 		$settings				Destination settings.
	 * @param	string		$remoteFile				Remote filename.
	 * @param	string		$localDestinationFile	Full path & filename of destination file.
	 *
	 */
download_file()
Download remote file to local system.

@param       array           $settings                               Destination settings.
@param       string          $remoteFile                             Remote filename.
@param       string          $localDestinationFile   Full path & filename of destination file.
download_file () Download remote file to local system . @param array $settings Destination settings . @param string $remoteFile Remote filename . @param string $localDestinationFile Full path & filename of destination file .
public static function download_file( $settings, $remoteFile, $localDestinationFile ) {
		require_once( dirname( dirname( __FILE__ ) ) . '/_s3lib/aws-sdk/sdk.class.php' );
		pb_backupbuddy::status( 'details', 'Downloading remote file `' . $remoteFile . '` from S3 to local file `' . $localDestinationFile . '`.' );
		$manage_data = pb_backupbuddy_destination_s3::get_credentials( $settings );
		$s3 = new AmazonS3( $manage_data );    
		if ( $settings['ssl'] == '0' ) {
			@$s3->disable_ssl(true);
		}
		if ( false === self::_prepareBucketAndRegion( $s3, $settings ) ) {
			return false;
		}
		$manage_data = pb_backupbuddy_destination_s3::get_credentials( $settings );
		$remotePath = self::get_remote_path( $settings['directory'] ); 
		$get_response = $s3->get_object( $manage_data['bucket'], $remotePath . $remoteFile, array( 'fileDownload' => $localDestinationFile ) );
		if ( ! $get_response->isOK() ) {
			pb_backupbuddy::status( 'error', 'Error #958483. Unable to retrieve S3 object `' . $remoteFile . '`.' );
			return false;
		} else {
			pb_backupbuddy::status( 'details', 'Success copying remote S3 object `' . $remoteFile . '` to local.' );
			return true;
		}
	}
public static function download_file ( $ settings , $ remoteFile , $ localDestinationFile ) { require_once ( dirname ( dirname ( __FILE__ ) ) . '/_s3lib/aws-sdk/sdk.class.php' ) ; pb_backupbuddy :: status ( 'details' , 'Downloading remote file `' . $ remoteFile . '` from S3 to local file `' . $ localDestinationFile . '`.' ) ; $ manage_data = pb_backupbuddy_destination_s3 :: get_credentials ( $ settings ) ; $ s3 = new AmazonS3 ( $ manage_data ) ; if ( $ settings [ 'ssl' ] == '0' ) { @ $ s3 -> disable_ssl ( true ) ; } if ( false === self :: _prepareBucketAndRegion ( $ s3 , $ settings ) ) { return false ; } $ manage_data = pb_backupbuddy_destination_s3 :: get_credentials ( $ settings ) ; $ remotePath = self :: get_remote_path ( $ settings [ 'directory' ] ) ; $ get_response = $ s3 -> get_object ( $ manage_data [ 'bucket' ] , $ remotePath . $ remoteFile , array ( 'fileDownload' => $ localDestinationFile ) ) ; if ( ! $ get_response -> isOK ( ) ) { pb_backupbuddy :: status ( 'error' , 'Error #958483. Unable to retrieve S3 object `' . $ remoteFile . '`.' ) ; return false ; } else { pb_backupbuddy :: status ( 'details' , 'Success copying remote S3 object `' . $ remoteFile . '` to local.' ) ; return true ; } }
download_file()
 Download remote file to local system.
download_file () Download remote file to local system .
// Connect to S3. // the key, secret, token // Verify bucket exists; create if not. Also set region to the region bucket exists in. // includes trailing slash.