backupbuddy_backup/wp-content/plugins/backupbuddy/classes/backup.php
/*	ms_copy_media()
	 *	
	 *	Used by Multisite Exporting.
	 *	Copies over media (wp-content/uploads) for this site for inclusion into the backup for creating a standalone backup from a subsite.
	 *	Authored by Ron H. Modified by Dustin B.
	 *	
	 *	@return		boolean			True on success, else false.
	 */


Used by Multisite Exporting.
Copies over media (wp-content/uploads) for this site for inclusion into the backup for creating a standalone backup from a subsite.
Authored by Ron H. Modified by Dustin B.

@return         boolean                 True on success, else false.
Used by Multisite Exporting . Copies over media ( wp - content / uploads ) for this site for inclusion into the backup for creating a standalone backup from a subsite . Authored by Ron H . Modified by Dustin B . @return boolean True on success else false .
public function ms_copy_media() {
		pb_backupbuddy::status( 'message', 'Copying media into temporary WordPress installation.' );
		$upload_dir = wp_upload_dir();
		$original_upload_base_dir = $upload_dir[ 'basedir' ];
		$destination_upload_base_dir = $this->_backup['backup_root'] . 'wp-content/uploads';
		$upload_contents = glob( $original_upload_base_dir . '/*' );
		if ( !is_array( $upload_contents ) ) {
			$upload_contents = array();
		}
		foreach( $upload_contents as $upload_content ) {
			if ( strpos( $upload_content, 'backupbuddy_' ) === false ) { 
				$result = pb_backupbuddy::$filesystem->recursive_copy( $upload_content, $destination_upload_base_dir . '/' . basename( $upload_content ) );
			}
		}
		if ( $result === false ) {
			pb_backupbuddy::status( 'error', 'Unable to copy media from `' . $original_upload_base_dir . '` to `' . $destination_upload_base_dir . '`. Verify permissions.' );
			return false;
		} else {
			pb_backupbuddy::status( 'details', 'Copied media from `' . $original_upload_base_dir . '` to `' . $destination_upload_base_dir . '`.' );
			return true;
		}
	}
public function ms_copy_media ( ) { pb_backupbuddy :: status ( 'message' , 'Copying media into temporary WordPress installation.' ) ; $ upload_dir = wp_upload_dir ( ) ; $ original_upload_base_dir = $ upload_dir [ 'basedir' ] ; $ destination_upload_base_dir = $ this -> _backup [ 'backup_root' ] . 'wp-content/uploads' ; $ upload_contents = glob ( $ original_upload_base_dir . '/*' ) ; if ( ! is_array ( $ upload_contents ) ) { $ upload_contents = array ( ) ; } foreach ( $ upload_contents as $ upload_content ) { if ( strpos ( $ upload_content , 'backupbuddy_' ) === false ) { $ result = pb_backupbuddy :: $ filesystem -> recursive_copy ( $ upload_content , $ destination_upload_base_dir . '/' . basename ( $ upload_content ) ) ; } } if ( $ result === false ) { pb_backupbuddy :: status ( 'error' , 'Unable to copy media from `' . $ original_upload_base_dir . '` to `' . $ destination_upload_base_dir . '`. Verify permissions.' ) ; return false ; } else { pb_backupbuddy :: status ( 'details' , 'Copied media from `' . $ original_upload_base_dir . '` to `' . $ destination_upload_base_dir . '`.' ) ; return true ; } }
ms_copy_media()
ms_copy_media ()
//Step 6 - Copy over media/upload files //$result = pb_backupbuddy::$filesystem->custom_copy( $original_upload_base_dir, $destination_upload_base_dir, array( 'ignore_files' => array( $this->_backup['serial'] ) ) ); // Grab directory upload contents so we can exclude backupbuddy directories. // Dont copy over any backupbuddy-prefixed uploads directories.