You are here

function backup_migrate_destination_nodesquirrel::_get_endpoints in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.3 includes/destinations.nodesquirrel.inc \backup_migrate_destination_nodesquirrel::_get_endpoints()
  2. 6.2 includes/destinations.nodesquirrel.inc \backup_migrate_destination_nodesquirrel::_get_endpoints()
  3. 7.2 includes/destinations.nodesquirrel.inc \backup_migrate_destination_nodesquirrel::_get_endpoints()

Retrieve the list of servers.

2 calls to backup_migrate_destination_nodesquirrel::_get_endpoints()
backup_migrate_destination_nodesquirrel::_xmlrpc in includes/destinations.nodesquirrel.inc
Get the form for the settings for this destination.
backup_migrate_destination_nodesquirrel::__xmlrpc in includes/destinations.nodesquirrel.inc
Get the form for the settings for this destination.

File

includes/destinations.nodesquirrel.inc, line 582
Functions to handle the NodeSquirrel backup destination.

Class

backup_migrate_destination_nodesquirrel
A destination for sending database backups to the NodeSquirel backup service.

Code

function _get_endpoints($refresh = FALSE, $retry = 3) {
  $servers = (array) variable_get('nodesquirrel_endpoint_urls', array());

  // No servers saved or a force refreshr required.
  if ($refresh || empty($servers)) {
    $servers = array_unique(array_merge($servers, variable_get('nodesquirrel_default_endpoint_urls', array(
      'api.nodesquirrel.com/services/xmlrpc',
    ))));

    // Call the get endpoints method but use the default or previous servers to avoid infinite loops.
    $new_servers = $this
      ->__xmlrpc('backups.getEndpoints', array(
      $this
        ->_get_destination(),
      'xmlrpc',
    ), $servers, $retry);
    if ($new_servers) {
      variable_set('nodesquirrel_endpoint_urls', $new_servers);
      $servers = $new_servers;
    }
  }
  return $servers;
}