You are here

function hosting_get_servers in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 server/hosting_server.module \hosting_get_servers()
  2. 7.3 server/hosting_server.module \hosting_get_servers()

Get servers providing a service.

Parameters

$service: Service type string, like 'http' or 'db'

Return value

An array of enabled servers, keys are the nid's of the nodes representing them, values are the titles of the servers.

See also

hook_hosting_servers_titles_alter()

13 calls to hosting_get_servers()
hostingService_dns_master::context_options in dns/hosting_dns.service.inc
hostingService_dns_master::form in dns/hosting_dns.service.inc
hostingService_dns_master::view in dns/hosting_dns.service.inc
hostingService_http_cluster::context_options in web_cluster/hosting_web_cluster.service.inc
hostingService_http_cluster::form in web_cluster/hosting_web_cluster.service.inc

... See full list

File

server/hosting_server.module, line 556

Code

function hosting_get_servers($service) {
  $return = array();
  $result = db_query("SELECT n.nid, n.title FROM {node} n INNER JOIN {hosting_service} s ON n.vid = s.vid AND s.available = 1 AND s.service = '%s'", $service);
  while ($server = db_fetch_object($result)) {
    $return[$server->nid] = $server->title;
  }
  drupal_alter('hosting_servers_titles', $return, $service);
  return $return;
}