public/wordpress/wp-content/plugins/backupbuddy/classes/restore.php
/* _priorRollbackCleanup()
	 *
	 * ROLLBACK
	 * Cleans up any existing temp database tables that exist from a prior failed/incomplete rollback that need removed.
	 *
	 */
_priorRollbackCleanup()
ROLLBACK
Cleans up any existing temp database tables that exist from a prior failed/incomplete rollback that need removed.
_priorRollbackCleanup () ROLLBACK Cleans up any existing temp database tables that exist from a prior failed / incomplete rollback that need removed .
private function _priorRollbackCleanup() {
		$this->_before( __FUNCTION__ );
		pb_backupbuddy::status( 'details', 'Checking for any prior failed rollback data to clean up.' );
		global $wpdb;
		$shortSerial = substr( $this->_state['serial'], 0, 4 );
		$sql = "SELECT table_name FROM information_schema.tables WHERE table_name LIKE 'bbnew-" . $shortSerial . "\_%' AND table_schema = DATABASE()";
		$results = $wpdb->get_results( $sql, ARRAY_A );
		pb_backupbuddy::status( 'details', 'Found ' . count( $results ) . ' tables to drop with the prefix `bbnew-' . $shortSerial . '_`.' );
		$dropCount = 0;
		foreach( $results as $result ) {
			if ( false === $wpdb->query( "DROP TABLE `" . backupbuddy_core::dbEscape( $result['table_name'] ) . "`" ) ) {
				$this->_error( 'Unable to delete table `' . $result['table_name'] . '`.' );
			} else {
				$dropCount++;
			}
		}
		pb_backupbuddy::status( 'details', 'Dropped `' . $dropCount . '` new tables.' );
		$sql = "SELECT table_name FROM information_schema.tables WHERE table_name LIKE 'bbold-" . $shortSerial . "\_%' AND table_schema = DATABASE()";
		$results = $wpdb->get_results( $sql, ARRAY_A );
		pb_backupbuddy::status( 'details', 'Found ' . count( $results ) . ' tables to drop with the prefix `bbold-' . $shortSerial . '_`.' );
		$dropCount = 0;
		foreach( $results as $result ) {
			if ( false === $wpdb->query( "DROP TABLE `" . backupbuddy_core::dbEscape( $result['table_name'] ) . "`" ) ) {
				$this->_error( 'Unable to delete table `' . $result['table_name'] . '`.' );
			} else {
				$dropCount++;
			}
		}
		pb_backupbuddy::status( 'details', 'Dropped `' . $dropCount . '` old tables.' );
		pb_backupbuddy::status( 'details', 'Finished prior rollback cleanup.' );
	}
private function _priorRollbackCleanup ( ) { $ this -> _before ( __FUNCTION__ ) ; pb_backupbuddy :: status ( 'details' , 'Checking for any prior failed rollback data to clean up.' ) ; global $ wpdb ; $ shortSerial = substr ( $ this -> _state [ 'serial' ] , 0 , 4 ) ; $ sql = " SELECT table_name FROM information_schema.tables WHERE table_name LIKE 'bbnew- " . $ shortSerial . " \_%' AND table_schema = DATABASE() " ; $ results = $ wpdb -> get_results ( $ sql , ARRAY_A ) ; pb_backupbuddy :: status ( 'details' , 'Found ' . count ( $ results ) . ' tables to drop with the prefix `bbnew-' . $ shortSerial . '_`.' ) ; $ dropCount = 0 ; foreach ( $ results as $ result ) { if ( false === $ wpdb -> query ( " DROP TABLE ` " . backupbuddy_core :: dbEscape ( $ result [ 'table_name' ] ) . " ` " ) ) { $ this -> _error ( 'Unable to delete table `' . $ result [ 'table_name' ] . '`.' ) ; } else { $ dropCount ++ ; } } pb_backupbuddy :: status ( 'details' , 'Dropped `' . $ dropCount . '` new tables.' ) ; $ sql = " SELECT table_name FROM information_schema.tables WHERE table_name LIKE 'bbold- " . $ shortSerial . " \_%' AND table_schema = DATABASE() " ; $ results = $ wpdb -> get_results ( $ sql , ARRAY_A ) ; pb_backupbuddy :: status ( 'details' , 'Found ' . count ( $ results ) . ' tables to drop with the prefix `bbold-' . $ shortSerial . '_`.' ) ; $ dropCount = 0 ; foreach ( $ results as $ result ) { if ( false === $ wpdb -> query ( " DROP TABLE ` " . backupbuddy_core :: dbEscape ( $ result [ 'table_name' ] ) . " ` " ) ) { $ this -> _error ( 'Unable to delete table `' . $ result [ 'table_name' ] . '`.' ) ; } else { $ dropCount ++ ; } } pb_backupbuddy :: status ( 'details' , 'Dropped `' . $ dropCount . '` old tables.' ) ; pb_backupbuddy :: status ( 'details' , 'Finished prior rollback cleanup.' ) ; }
_priorRollbackCleanup()
 ROLLBACK
 Cleans up any existing temp database tables that exist from a prior failed/incomplete rollback that need removed.
_priorRollbackCleanup () ROLLBACK Cleans up any existing temp database tables that exist from a prior failed / incomplete rollback that need removed .
// NEW prefix // OLD prefix