public/wordpress/wp-content/plugins/backupbuddy/destinations/live/init.php
/* _get_live_action_response()
	 *
	 * Retrieves response from calling the 'live' Stash API action. Caches response for a period of time unless forced to bust.
	 *
	 */
_get_live_action_response()
Retrieves response from calling the 'live' Stash API action. Caches response for a period of time unless forced to bust.
_get_live_action_response () Retrieves response from calling the ' live ' Stash API action . Caches response for a period of time unless forced to bust .
private static function _get_live_action_response( $settings, $bust_cache = false ) {
		if ( true === $bust_cache ) {
			delete_transient( self::LIVE_ACTION_TRANSIENT_NAME );
		}
		if ( false === ( $response = get_transient( self::LIVE_ACTION_TRANSIENT_NAME ) ) ) {
			$stashAction = 'live';
			$additionalParams = array();
			$response = self::stashAPI( $settings, $stashAction, $additionalParams );
			if ( ! is_array( $response ) ) {
				$error = 'Error #344080: Unable to initiate Live send retrieval of manage data. Details: `' . $response . '`.';
				pb_backupbuddy::status( 'error', $error );
				backupbuddy_core::addNotification( 'live_error', 'BackupBuddy Stash Live Error', $error );
				return false;
			}
			if ( pb_backupbuddy::$options['log_level'] == '3' ) { 
				pb_backupbuddy::status( 'details', 'Live API live action response due to logging level: `' . print_r( $response, true ) . '`. Call params: `' . print_r( $additionalParams, true ) . ' `.' );
			}
			$cache_time = self::LIVE_ACTION_TRANSIENT_CACHE_TIME; 
			set_transient( self::LIVE_ACTION_TRANSIENT_NAME, $response, $cache_time );
			pb_backupbuddy::status( 'details', 'Caching Live action response data in transient `' . self::LIVE_ACTION_TRANSIENT_NAME . '`.' );
		} else {
		}
		return $response;
	}
private static function _get_live_action_response ( $ settings , $ bust_cache = false ) { if ( true === $ bust_cache ) { delete_transient ( self :: LIVE_ACTION_TRANSIENT_NAME ) ; } if ( false === ( $ response = get_transient ( self :: LIVE_ACTION_TRANSIENT_NAME ) ) ) { $ stashAction = 'live' ; $ additionalParams = array ( ) ; $ response = self :: stashAPI ( $ settings , $ stashAction , $ additionalParams ) ; if ( ! is_array ( $ response ) ) { $ error = 'Error #344080: Unable to initiate Live send retrieval of manage data. Details: `' . $ response . '`.' ; pb_backupbuddy :: status ( 'error' , $ error ) ; backupbuddy_core :: addNotification ( 'live_error' , 'BackupBuddy Stash Live Error' , $ error ) ; return false ; } if ( pb_backupbuddy :: $ options [ 'log_level' ] == '3' ) { pb_backupbuddy :: status ( 'details' , 'Live API live action response due to logging level: `' . print_r ( $ response , true ) . '`. Call params: `' . print_r ( $ additionalParams , true ) . ' `.' ) ; } $ cache_time = self :: LIVE_ACTION_TRANSIENT_CACHE_TIME ; set_transient ( self :: LIVE_ACTION_TRANSIENT_NAME , $ response , $ cache_time ) ; pb_backupbuddy :: status ( 'details' , 'Caching Live action response data in transient `' . self :: LIVE_ACTION_TRANSIENT_NAME . '`.' ) ; } else { } return $ response ; }
_get_live_action_response()
 Retrieves response from calling the 'live' Stash API action.
_get_live_action_response () Retrieves response from calling the ' live ' Stash API action .
// Get credentials via LIVE action and cache them for future calls. // Full logging enabled. // Calculate credential expiration for caching minus 1.5 hour for wiggle around DST and such issues. //$cache_time = ( $response['expires'] - self::LIVE_ACTION_TRANSIENT_EXPIRE_WIGGLE ); // Cache 6 hours. //pb_backupbuddy::status( 'details', 'Using cached Live credentials.' );