public/wordpress/wp-content/plugins/backupbuddy/destinations/live/live_periodic.php
/* _process_internal_delete_queue()
	 *
	 * API call to actually delete files queued for deletion. Updated catalog and stats variables.
	 *
	 */
_process_internal_delete_queue()
API call to actually delete files queued for deletion. Updated catalog and stats variables.
_process_internal_delete_queue () API call to actually delete files queued for deletion . Updated catalog and stats variables .
private static function _process_internal_delete_queue( $destination_settings, &$deleteQueue, &$filesDeleted ) {
		if ( count( $deleteQueue ) <= 0 ) {
			return true;
		}
		pb_backupbuddy::status( 'details', 'Processing internal deletion queue on `' . count( $deleteQueue ) . '` files.' );
		if ( true !== ( $delete_result = pb_backupbuddy_destination_live::deleteFiles( $destination_settings, $deleteQueue ) ) ) {
			pb_backupbuddy::status( 'error', 'Error #8239833: Unable to delete remote file(s) `' . implode( '; ', $deleteQueue ) . '`' );
			return false;
		} elseif ( true === $delete_result ) {
			foreach( $deleteQueue as $signatureFile ) {
				unset( self::$_catalog[ $signatureFile ] );
			}
			$deleted_count = count( $deleteQueue );
			$remaining = ( self::$_state['stats']['files_pending_delete'] - $deleted_count );
			if ( $remaining < 0 ) {
				$remaining = 0;
			}
			$last_deleted = end( $deleteQueue ); 
			self::$_state['stats']['files_pending_delete'] = self::$_state['stats']['files_pending_delete'] - $deleted_count;
			if ( self::$_state['stats']['files_pending_delete'] < 0 ) {
				self::$_state['stats']['files_pending_delete'] = 0;
			}
			$deleteQueue = array(); 
			$filesDeleted += $deleted_count;
			pb_backupbuddy::status( 'details', 'Deleted `' . $deleted_count . '` remote files (' . $remaining . ' remain). Last file deleted in current queue: `' . $last_deleted . '`.' );
			return true;
		}
	}
private static function _process_internal_delete_queue ( $ destination_settings , & $ deleteQueue , & $ filesDeleted ) { if ( count ( $ deleteQueue ) <= 0 ) { return true ; } pb_backupbuddy :: status ( 'details' , 'Processing internal deletion queue on `' . count ( $ deleteQueue ) . '` files.' ) ; if ( true !== ( $ delete_result = pb_backupbuddy_destination_live :: deleteFiles ( $ destination_settings , $ deleteQueue ) ) ) { pb_backupbuddy :: status ( 'error' , 'Error #8239833: Unable to delete remote file(s) `' . implode ( '; ' , $ deleteQueue ) . '`' ) ; return false ; } elseif ( true === $ delete_result ) { foreach ( $ deleteQueue as $ signatureFile ) { unset ( self :: $ _catalog [ $ signatureFile ] ) ; } $ deleted_count = count ( $ deleteQueue ) ; $ remaining = ( self :: $ _state [ 'stats' ] [ 'files_pending_delete' ] - $ deleted_count ) ; if ( $ remaining < 0 ) { $ remaining = 0 ; } $ last_deleted = end ( $ deleteQueue ) ; self :: $ _state [ 'stats' ] [ 'files_pending_delete' ] = self :: $ _state [ 'stats' ] [ 'files_pending_delete' ] - $ deleted_count ; if ( self :: $ _state [ 'stats' ] [ 'files_pending_delete' ] < 0 ) { self :: $ _state [ 'stats' ] [ 'files_pending_delete' ] = 0 ; } $ deleteQueue = array ( ) ; $ filesDeleted += $ deleted_count ; pb_backupbuddy :: status ( 'details' , 'Deleted `' . $ deleted_count . '` remote files (' . $ remaining . ' remain). Last file deleted in current queue: `' . $ last_deleted . '`.' ) ; return true ; } }
_process_internal_delete_queue()
 API call to actually delete files queued for deletion.
_process_internal_delete_queue () API call to actually delete files queued for deletion .
// Return true on empty queue. // Remove each deleted file from catalog and update stats. // Remove file from catalog and update state stats. IMPORTANT: DO NOT SAVE CATALOG UNTIL QUEUE PROCESSED. // Calculate some local stats on what just happened for log. // Move array pointer to end of queue. // Update state stats. // Clear $deleteQueue reference. // Clear out queue. // Update $filesDeleted reference.