public/wordpress/wp-content/plugins/backupbuddy/classes/backup.php
/*	ms_download_extract_wordpress()
	 *	
	 *	Used by Multisite Exporting.
	 *	Downloads and extracts the latest WordPress for making a standalone backup of a subsite.
	 *	Authored by Ron H. Modified by Dustin B.
	 *	
	 *	@return		boolean		True on success, else false.
	 */


Used by Multisite Exporting.
Downloads and extracts the latest WordPress for making a standalone backup of a subsite.
Authored by Ron H. Modified by Dustin B.

@return         boolean         True on success, else false.
Used by Multisite Exporting . Downloads and extracts the latest WordPress for making a standalone backup of a subsite . Authored by Ron H . Modified by Dustin B . @return boolean True on success else false .
public function ms_download_extract_wordpress() {
		if ( !function_exists( 'download_url' ) ) {
			pb_backupbuddy::status( 'details', 'download_url() function not available by default. Loading `/wp-admin/includes/file.php`.' );
			require_once( ABSPATH . 'wp-admin/includes/file.php' );
		}
		$wp_url = 'http://wordpress.org/latest.zip';
		pb_backupbuddy::status( 'details', 'Downloading latest WordPress ZIP file from `' . $wp_url . '`.' );
		$wp_file = download_url( $wp_url );
		if ( is_wp_error( $wp_file ) ) { 
			pb_backupbuddy::status( 'error', 'Error getting latest WordPress ZIP file: `' . $wp_file->get_error_message() . '`.' );
			return false;
		} else { 
			pb_backupbuddy::status( 'details', 'Latest WordPress ZIP file successfully downloaded to `' . $wp_file . '`.' );
		}
		if ( !isset( pb_backupbuddy::$classes['zipbuddy'] ) ) {
			pb_backupbuddy::$classes['zipbuddy'] = new pluginbuddy_zipbuddy( backupbuddy_core::getBackupDirectory() );
		}
		pb_backupbuddy::status( 'details', 'About to unzip file `' . $wp_file . '` into `' . $this->_backup['backup_root'] . '`.' );
		ob_start();
		pb_backupbuddy::$classes['zipbuddy']->unzip( $wp_file, dirname( $this->_backup['backup_root'] ) );
		pb_backupbuddy::status( 'details', 'Unzip complete.' );
		pb_backupbuddy::status( 'details', 'Debugging information: `' . ob_get_clean() . '`' );
		@unlink( $wp_file );
		if ( file_exists( $wp_file ) ) { 
			pb_backupbuddy::status( 'warning', 'Unable to delete temporary WordPress file `' . $wp_file . '`. You may want to delete this after the backup / export completed.' );
		}
		return true;
	}
public function ms_download_extract_wordpress ( ) { if ( ! function_exists ( 'download_url' ) ) { pb_backupbuddy :: status ( 'details' , 'download_url() function not available by default. Loading `/wp-admin/includes/file.php`.' ) ; require_once ( ABSPATH . 'wp-admin/includes/file.php' ) ; } $ wp_url = 'http://wordpress.org/latest.zip' ; pb_backupbuddy :: status ( 'details' , 'Downloading latest WordPress ZIP file from `' . $ wp_url . '`.' ) ; $ wp_file = download_url ( $ wp_url ) ; if ( is_wp_error ( $ wp_file ) ) { pb_backupbuddy :: status ( 'error' , 'Error getting latest WordPress ZIP file: `' . $ wp_file -> get_error_message ( ) . '`.' ) ; return false ; } else { pb_backupbuddy :: status ( 'details' , 'Latest WordPress ZIP file successfully downloaded to `' . $ wp_file . '`.' ) ; } if ( ! isset ( pb_backupbuddy :: $ classes [ 'zipbuddy' ] ) ) { pb_backupbuddy :: $ classes [ 'zipbuddy' ] = new pluginbuddy_zipbuddy ( backupbuddy_core :: getBackupDirectory ( ) ) ; } pb_backupbuddy :: status ( 'details' , 'About to unzip file `' . $ wp_file . '` into `' . $ this -> _backup [ 'backup_root' ] . '`.' ) ; ob_start ( ) ; pb_backupbuddy :: $ classes [ 'zipbuddy' ] -> unzip ( $ wp_file , dirname ( $ this -> _backup [ 'backup_root' ] ) ) ; pb_backupbuddy :: status ( 'details' , 'Unzip complete.' ) ; pb_backupbuddy :: status ( 'details' , 'Debugging information: `' . ob_get_clean ( ) . '`' ) ; @ unlink ( $ wp_file ) ; if ( file_exists ( $ wp_file ) ) { pb_backupbuddy :: status ( 'warning' , 'Unable to delete temporary WordPress file `' . $ wp_file . '`. You may want to delete this after the backup / export completed.' ) ; } return true ; }
ms_download_extract_wordpress()
ms_download_extract_wordpress ()
// Step 1 - Download a copy of WordPress. // Grabbing WordPress ZIP failed. // Grabbing WordPress ZIP succeeded. //error_log ('nowperror' ); // Step 2 - Extract WP into a separate directory. // Check to see if unlink() worked.